/**
 * @file /src/main_window.cpp
 *
 * @brief Implementation for the qt gui.
 *
 * @date February 2011
 **/
/*****************************************************************************
** Includes
*****************************************************************************/

#include <QtGui>
#include <QMessageBox>
#include <iostream>
#include "../include/gui/main_window.hpp"
#include "../include/gui/ui_data.h"
#include "include/led/led_node.h"

/*****************************************************************************
** Namespaces
*****************************************************************************/

namespace gui {

using namespace Qt;

int CarTypeStatus = 1;   //机器人类型:1.抱手;2.磁吸;3.半自动;4.棉包车;5.大叉车

int PositionMode = 0;
int SafeLamp = 0;
int control = 0;
int iBattery = 0;
int timecount = 0;
int ShowData = 1;
int AssignmentNumMain = 0;
int CreatLog = 0;
int ledStatus;
int LedOpenCloseMode = 0;   //是否启用led
int sensorStatus;
int ledStatusReal = 0;
int ledStatusZero = 0;
int checkCount = 0;
int battery_i = 0;
int cleanChargeMode = 0;
int CarTypeMode = 0;
float treadAll = 998;
float axleAll = 586;
int AlarmHandle_status = 0;
uint8_t impact_status = 0;
uint32_t server_mission_Id_last = 0;
int from_pc_check_net_connection_show = 0;
int from_pc_check_net_connection_show2 = 0;
int PcAgvScreenComStatusCount = 0;
int PcAgvScreenComStatusLast = 0;
int PcAgvScreenComStatusAlarm = 0;
QString getIP;
QString path;
QString LogFullPath = "/home/lk/log/download/screen_glog";
//QString LogFullPath = "/home/sjx/log/download/screen";
//QVector<log_info_t> log_info_re_show;
QString getNetIP;
std::string ledWord;
QString ledScreenIP;
std::string ledIP = "192.168.60.10";
uint32_t ledport = 5005;
QString datazero = "datazero";
int ultr_data1 = 0;
int ultr_data2 = 0;
int Radar_Area1 = 0;
int Radar_Area2 = 0;
int MOTOR_NUM_T = 0;
int FanControl[4];

/*****************************************************************************
** Implementation [MainWindow]
*****************************************************************************/

MainWindow::MainWindow(int argc, char** argv, QWidget *parent)
	: QMainWindow(parent)
  , qnode(argc,argv)
{
  GetParaFromJson();
  CarTypeModeParaChange();


  this->setGeometry(0,0,1310,758);

  ui.setupUi(this); // Calling this incidentally connects all ui's triggers to on_...() callbacks in this class.
//    QObject::connect(ui.actionAbout_Qt, SIGNAL(triggered(bool)), qApp, SLOT(aboutQt())); // qApp is a global variable for the application

//    ReadSettings();
  if(CarTypeStatus == 1)
  {
//    setWindowIcon(QIcon(":/image/4dai/4Gen.png"));
//    led_board_init();
    setWindowIcon(QIcon(":/image/clean.png"));
    on_LightBtn_fork_clicked();
  }
  else if(CarTypeStatus == 2)
  {
    setWindowIcon(QIcon(":/image/4dai/magnet.png"));
    led_board_init();
  }
  else if(CarTypeStatus == 3)
  {
    setWindowIcon(QIcon(":/image/seni.png"));
  }
  else if(CarTypeStatus == 4)
  {
    setWindowIcon(QIcon(":/image/chache/chache2.png"));
    on_LightBtn_Cotton_clicked();
  }
  else if(CarTypeStatus == 5)
  {
    setWindowIcon(QIcon(":/image/smallred.png"));
    on_LightBtn_fork_clicked();
  }
  else if(CarTypeStatus == 6)
  {
    setWindowIcon(QIcon(":/image/clean.png"));
    on_LightBtn_fork_clicked();
  }

//  setWindowIcon(QIcon(":/images/icon.png"));

//  ui.tab_manager->setCurrentIndex(0); // ensure the first tab is showing - qt-designer should have this already hardwired, but often loses it (settings?).
//    QObject::connect(&qnode, SIGNAL(rosShutdown()), this, SLOT(close()));

//  /*********************
//  ** Logging
//  **********************/
//  ui.view_logging->setModel(qnode.loggingModel());
//    QObject::connect(&qnode, SIGNAL(loggingUpdated()), this, SLOT(updateLoggingView()));

//    /*********************
//    ** Auto Start
//    **********************/
//    if ( ui.checkbox_remember_settings->isChecked() ) {
//        on_button_connect_clicked(true);
//    }
//  this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);//隐藏边框
// setWindowFlags(Qt::Tool | Qt::X11BypassWindowManagerHint);

    this->showMaximized();

  connect(this, SIGNAL(AlarmWaining(int)), &MyAlarmShow, SLOT(AlarmShowInit(int)));
  connect(&qnode, SIGNAL(guiShutdown()), this, SLOT(MainWindowClose()));

  MotorBntSet();
  GetSensorPara();
  inittimerr();
  LogDirExist(LogFullPath);
  on_Mainwindowshow_clicked();
//    led_board_init();
  MotorBntSet();
  GetParaFromJsonPosition();
  ButtonStyle();
}

MainWindow::~MainWindow()
{

}

void MainWindow::MainWindowClose()
{
  this->close();
}

//主界面关闭按钮
void MainWindow::on_Close_clicked()
{
//  this->showMinimized();
    this->close();
//  this->hide();
//    MyAlarm.close();
//    MySystem.close();
//    MyParameter.close();
}

/***********************************************************************************
名称:inittimerr
输入:无
输出:无
作用:连接定时器，1S触发一次，1S后触发
***********************************************************************************/
void MainWindow::inittimerr()
{
    connect(&MyTimer,SIGNAL(timeout()),this,SLOT(Mytimer_change()));
    MyTimer.start(1000);                                       //一秒钟后开始触发
    MyTimer.singleShot(1000,this,SLOT(Mytimer_change()));      //1秒钟触发一次
}
/***********************************************************************************
名称:Mytimer_change
输入:无
输出:无
作用:每秒执行函数一次
***********************************************************************************/
void MainWindow::Mytimer_change()
{


//  ScreenGetReady();
  Alarmchange();
  ParameterChange();
  System_Show();
  BatteryInfoShow();
  MotorParaChange();

  ReceivePara();

  BatteryDecode();
  ScreenOperateDataInfoSend();
  IODecode();
  PcRobotStatusRunDecode();
  PcInfoDecode();
  PcNetStatusDecode();
  PcAgvScreenComStatus();
  ArmRunInfoDecode();
  GyroInfoDecode();
  MotorInfoDecode();
  MissionInfoDecode();
  MechanicalParametersDecode();
  AgvSwStateDecode();
  SelfTaskInfoDecode();
  RemoteControlReDecde();
  EcolineInfoReDecode();

  GetSensorPara();
  RobotParaShow();
  showSystemBtn();
  showCarTypeBtn();
  CarTypeModeParaChange();
  if(CarTypeStatus == 1)
  {
    AlarmHandle();
  }

//  qDebug() << "cartypestatus = " << CarTypeStatus;
//  qDebug() << "cartypestatus1111 = " << CarTypeMode;

  Robot_Base_Data_Show();

  battery_status_.percentage = qnode.battery_info_re_.percentage;

  //
  from_pc_check_net_connection = qnode.network_info_re_.data;

  version_status = QString::fromStdString(qnode.version.data);

  timecount++;

  taskNameShow();

  //是否启用led
  if(LedOpenCloseMode == 1)
  {
    if(CarTypeStatus == 1 || CarTypeStatus == 2) //是否有led显示屏
    {
      //2自定义时候  任务ID变化发送一次
      if((ledStatus == 2) && (ledStatusReal == 0))
      {
        std::cout << ledWord << std::endl;
        unsigned char* program_char;        // QByteArray转化为char*
        program_char = (unsigned char *)ledWord.data();
        LedScreenShow(program_char);

        qDebug("22222222222222222");

        ledStatusReal = 1;
        ledStatusZero = 0;
        server_mission_Id_last = 0;
      }
      else if(ledStatus == 0 && ledStatusZero == 0)
      {
        qDebug("zero");

    //    bxDual_dynamicArea_DelArea_6G(ip, port, 0)
    //    led_delete_programflie();

        QString ledzero = " ";
        unsigned char* program_char;        // QByteArray转化为char*
        program_char = (unsigned char *)ledzero.data();
        LedScreenShow(program_char);

        ledStatusZero = 1;
        ledStatusReal = 0;
        server_mission_Id_last = 0;
      }
      else if(ledStatus == 1)
      {
        if(server_mission_Id_last == 0 && mission_info_.serverMissionId == 0)
        {
          ledTask();
          server_mission_Id_last = 1;
        }

        //实时的时候  任务ID变化发送一次
        else if(server_mission_Id_last != mission_info_.serverMissionId && mission_info_.serverMissionId != 0)
        {
          ledTask();
          server_mission_Id_last = mission_info_.serverMissionId;
          ledStatusReal = 0;
          ledStatusZero = 0;
          qDebug("11111111111111111111");
        }
      }
    }
  }
}

/***********************************************************************************
名称:MotorBntSet
输入:无
输出:无
作用:电机警报显示ui关联函数
***********************************************************************************/
void MainWindow::MotorBntSet(void)
{
  if(CarTypeStatus == 1)
  {
    MyMotor[0] =  ui.Motor1;
    MyMotor[1] =  ui.Motor2;
    MyMotor[2] =  ui.Motor3;
    MyMotor[3] =  ui.Motor4;
    MyMotor[4] =  ui.Motor5;
    MyMotor[5] =  ui.Motor6;
    MyMotorBnt[0] =  ui.Motor1Btu;
    MyMotorBnt[1] =  ui.Motor2Btu;
    MyMotorBnt[2] =  ui.Motor3Btu;
    MyMotorBnt[3] =  ui.Motor4Btu;
    MyMotorBnt[4] =  ui.Motor5Btu;
    MyMotorBnt[5] =  ui.Motor6Btu;
    alarmFlag[0] = &alarm_staus_.motor1_alarm_status;
    alarmFlag[1] = &alarm_staus_.motor2_alarm_status;
    alarmFlag[2] = &alarm_staus_.motor3_alarm_status;
    alarmFlag[3] = &alarm_staus_.motor4_alarm_status;
    alarmFlag[4] = &alarm_staus_.motor5_alarm_status;
    alarmFlag[5] = &alarm_staus_.motor6_alarm_status;
  }
  else if(CarTypeStatus == 2)
  {
    MyMotor[0] =  ui.Motor1_Ma;
    MyMotor[1] =  ui.Motor2_Ma;
    MyMotor[2] =  ui.Motor3_Ma;
    MyMotor[3] =  ui.Motor4_Ma;
    MyMotorBnt[0] =  ui.Motor1Btu_Ma;
    MyMotorBnt[1] =  ui.Motor2Btu_Ma;
    MyMotorBnt[2] =  ui.Motor3Btu_Ma;
    MyMotorBnt[3] =  ui.Motor4Btu_Ma;
    alarmFlag[0] = &alarm_staus_.motor1_alarm_status;
    alarmFlag[1] = &alarm_staus_.motor2_alarm_status;
    alarmFlag[2] = &alarm_staus_.motor3_alarm_status;
    alarmFlag[3] = &alarm_staus_.motor4_alarm_status;
  }
  else if(CarTypeStatus == 3)
  {
    MyMotor[0] =  ui.Motor1_Semi;
    MyMotor[1] =  ui.Motor2_Semi;
    MyMotor[2] =  ui.Motor3_Semi;
    MyMotor[3] =  ui.Motor4_Semi;
    MyMotor[4] =  ui.Motor5_Semi;
    MyMotor[5] =  ui.Motor6_Semi;
    MyMotorBnt[0] =  ui.Motor1Btu_Semi;
    MyMotorBnt[1] =  ui.Motor2Btu_Semi;
    MyMotorBnt[2] =  ui.Motor3Btu_Semi;
    MyMotorBnt[3] =  ui.Motor4Btu_Semi;
    MyMotorBnt[4] =  ui.Motor5Btu_Semi;
    MyMotorBnt[5] =  ui.Motor6Btu_Semi;
    alarmFlag[0] = &alarm_staus_.motor1_alarm_status;
    alarmFlag[1] = &alarm_staus_.motor2_alarm_status;
    alarmFlag[2] = &alarm_staus_.motor3_alarm_status;
    alarmFlag[3] = &alarm_staus_.motor4_alarm_status;
    alarmFlag[4] = &alarm_staus_.motor5_alarm_status;
    alarmFlag[5] = &alarm_staus_.motor6_alarm_status;
  }
  else if(CarTypeStatus == 4 || CarTypeStatus == 5)
  {
    MyMotor[0] =  ui.Motor1_Cotton;
    MyMotor[1] =  ui.Motor2_Cotton;
    MyMotor[2] =  ui.Motor3_Cotton;
    MyMotorBnt[0] =  ui.Motor1Btu_Cotton;
    MyMotorBnt[1] =  ui.Motor2Btu_Cotton;
    MyMotorBnt[2] =  ui.Motor3Btu_Cotton;
    alarmFlag[0] = &alarm_staus_.motor1_alarm_status;
    alarmFlag[1] = &alarm_staus_.motor2_alarm_status;
    alarmFlag[2] = &alarm_staus_.motor3_alarm_status;
  }
}

void MainWindow::ButtonStyle()
{
  ui.CarTypeBSMotor5->setStyleSheet(
        //设置普通状态样式
        "#CarTypeBSMotor5:focus{outline: none;}"
        "#CarTypeBSMotor5{"
        "background-image:url(:/image/chache/lightbulebtn.png);"
        "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
        "color:rgb(255,255,255);"                            //字体颜色
        "border-radius:10px;"                           //边框圆角
//        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
         "font-size:24pt;"                              //字体类型和字体大小
         "text-align: center;"
        "}"

        //设置按下状态样式
        "#CarTypeBSMotor5:pressed{"
        "background-image:url(:/image/chache/greenbtn.png);"
        "}"
        );

  ui.CarTypeBSMotor6->setStyleSheet(
        //设置普通状态样式
        "#CarTypeBSMotor6:focus{outline: none;}"
        "#CarTypeBSMotor6{"
        "background-image:url(:/image/chache/lightbulebtn.png);"
        "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
        "color:rgb(255,255,255);"                            //字体颜色
        "border-radius:10px;"                           //边框圆角
//        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
         "font-size:24pt;"                              //字体类型和字体大小
         "text-align: center;"
        "}"

        //设置按下状态样式
        "#CarTypeBSMotor6:pressed{"
        "background-image:url(:/image/chache/greenbtn.png);"
        "}"
        );
  ui.CarTypeCXMotor4->setStyleSheet(
        //设置普通状态样式
        "#CarTypeCXMotor4:focus{outline: none;}"
        "#CarTypeCXMotor4{"
        "background-image:url(:/image/chache/lightbulebtn.png);"
        "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
        "color:rgb(255,255,255);"                            //字体颜色
        "border-radius:10px;"                           //边框圆角
//        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
         "font-size:24pt;"                              //字体类型和字体大小
         "text-align: center;"
        "}"

        //设置按下状态样式
        "#CarTypeCXMotor4:pressed{"
        "background-image:url(:/image/chache/greenbtn.png);"
        "}"
        );
  ui.CarTypeDCXMotor3->setStyleSheet(
        //设置普通状态样式
        "#CarTypeDCXMotor3:focus{outline: none;}"
        "#CarTypeDCXMotor3{"
        "background-image:url(:/image/chache/lightbulebtn.png);"
        "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
        "color:rgb(255,255,255);"                            //字体颜色
        "border-radius:10px;"                           //边框圆角
//        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
         "font-size:24pt;"                              //字体类型和字体大小
         "text-align: center;"
        "}"

        //设置按下状态样式
        "#CarTypeDCXMotor3:pressed{"
        "background-image:url(:/image/chache/greenbtn.png);"
        "}"
        );
  ui.CarTypeMBmotor3->setStyleSheet(
        //设置普通状态样式
        "#CarTypeMBmotor3:focus{outline: none;}"
        "#CarTypeMBmotor3{"
        "background-image:url(:/image/chache/lightbulebtn.png);"
        "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
        "color:rgb(255,255,255);"                            //字体颜色
        "border-radius:10px;"                           //边框圆角
//        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
         "font-size:24pt;"                              //字体类型和字体大小
         "text-align: center;"
        "}"

        //设置按下状态样式
        "#CarTypeMBmotor3:pressed{"
        "background-image:url(:/image/chache/greenbtn.png);"
        "}"
        );
  ui.CarTypeBZDMotor6->setStyleSheet(
        //设置普通状态样式
        "#CarTypeBZDMotor6:focus{outline: none;}"
        "#CarTypeBZDMotor6{"
        "background-image:url(:/image/chache/lightbulebtn.png);"
        "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
        "color:rgb(255,255,255);"                            //字体颜色
        "border-radius:10px;"                           //边框圆角
//        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
         "font-size:24pt;"                              //字体类型和字体大小
         "text-align: center;"
        "}"

        //设置按下状态样式
        "#CarTypeBZDMotor6:pressed{"
        "background-image:url(:/image/chache/greenbtn.png);"
        "}"
        );
}
/***********************************************************************************
名称:ScreenGetReady
输入:无
输出:无
作用:屏幕界面更新提示函数,打开显示屏幕更新提示语
***********************************************************************************/
void MainWindow::ScreenGetReady()
{
  ui.RobotBack->setPixmap(QPixmap(":/image/screen.png"));
  ui.Position->hide();
//  ui.Motor5Alarm->hide();
//  ui.BatteryLow->hide();
//  ui.ObstacleAlarm->hide();
//  ui.impact->hide();
  ui.label_10->hide();
  ui.label_11->hide();
  ui.label_12->hide();
  ui.label->hide();
  ui.label_3->hide();
  ui.label_5->hide();
  ui.label_7->hide();
  ui.Number_2->hide();
  ui.Number_4->hide();
  ui.Number_7->hide();
  ui.Number_10->hide();
  ui.CommunitionCheck->hide();
  ui.CommunitionCheck_agv->hide();
  ui.ArmCommunitionCheck->hide();
  ui.Number_robot->hide();
  ui.Connect_check->hide();
//  ui.RemoteStatus->hide();
  ui.IP->hide();
  ui.Mis_sub->hide();
  ui.SubMisType->hide();
  ui.Ser_mis_id->hide();
  ui.TaskType->hide();
//  ui.LoadingBtn->hide();
//  ui.DischargeBtn->hide();
}
/******************************************************************************/
/***************************消息获取解析数据函数**********************************/
/******************************************************************************/
/***********************************************************************************
名称:BatteryDecode
输入:无
输出:无
作用:电池数据获取函数,获取电池各种实时参数
***********************************************************************************/
void MainWindow::BatteryDecode()
{
    battery_status_.percentage = qnode.battery_info_re_.percentage;
    battery_status_.count = qnode.battery_info_re_.count;
    battery_status_.current = qnode.battery_info_re_.current;
    battery_status_.errorCode = qnode.battery_info_re_.errorCode;
    battery_status_.serialNum = qnode.battery_info_re_.serialNum;
    battery_status_.powerLowLimmit = qnode.battery_info_re_.powerLowLimmit;
    battery_status_.voltage = qnode.battery_info_re_.voltage;
    battery_status_.state.data = qnode.battery_info_re_.state;
    battery_status_.temperature = qnode.battery_info_re_.temperature;
}

/***********************************************************************************
名称:IODecode
输入:无
输出:无
作用:IO口数据获取函数,获取IO口各种实时参数
***********************************************************************************/
void MainWindow::IODecode()
{
  if(CarTypeStatus == 1)
  {
    control = qnode.io_send_.state;
    control = (qnode.io_send_.state >> 2) & 0x03;
    AgvInit = (qnode.io_send_.count & 0xffff);
    IO_motor_.read = qnode.io_send_.count >> 16;
    IO_stauts.state.data = qnode.io_send_.state;

    rtu317f_clean.in.read = qnode.io_send_.in1 | (qnode.io_send_.in2 << 8);

  //    rtu3072.read = qnode.io_send_.in3 | (qnode.io_send_.in4 << 8);
  //    rtu317.read = qnode.io_send_.in1 | (qnode.io_send_.in2 << 8) | (qnode.io_send_.in3 << 16) | (qnode.io_send_.in4 << 24);
    rtu317f_clean.out.write = qnode.io_send_.out1 | (qnode.io_send_.out2 << 8);
    cleanChargeMode = qnode.io_send_.out3;

    errmask_Cotton_.mask.b.impact = qnode.io_send_.mask1 & 0x01;

    int radarArea1011 = qnode.io_send_.mask3;
    int radarArea2011 = qnode.io_send_.mask4;

    if(radarArea1011 > 5)
    {
      errmask_Cotton_.mask.b.radarArea101 = 0;
    }
    else
    {
      errmask_Cotton_.mask.b.radarArea101 = radarArea1011;
    }

    if(radarArea2011 > 5)
    {
      errmask_Cotton_.mask.b.radarArea201 = 0;
    }
    else
    {
      errmask_Cotton_.mask.b.radarArea201 = radarArea2011;
    }

//    qDebug() << "errmask_cotton = " << errmask_Cotton_.mask.b.radarArea101;
//    errmask_Cotton_.mask.data = 255;

    SafeRadar_L.areaSign.bit.b0 = rtu317f_clean.in.ch.bit13_sgnSafeRadar21;
    SafeRadar_L.areaSign.bit.b1 = rtu317f_clean.in.ch.bit14_sgnSafeRadar22;
    SafeRadar_L.areaSign.bit.b2 = rtu317f_clean.in.ch.bit15_sgnSafeRadar23;
    SafeRadar_L.areaSign.bit.b3 = 0;

    SafeRadarStatus_L = SafeRadar_L.areaSign.data & 0x07;

    SafeRadar_R.areaSign.bit.b0 = rtu317f_clean.in.ch.bit10_sgnSafeRadar11;
    SafeRadar_R.areaSign.bit.b1 = rtu317f_clean.in.ch.bit11_sgnSafeRadar12;
    SafeRadar_R.areaSign.bit.b2 = rtu317f_clean.in.ch.bit12_sgnSafeRadar13;
    SafeRadar_R.areaSign.bit.b3 = 0;

    SafeRadarStatus_R = SafeRadar_R.areaSign.data & 0x07;

//    SafeRadar_R.areaSign.bit.b0 = rtu317_Cotton.ch.bit4_radarControl21;
//    SafeRadar_R.areaSign.bit.b1 = rtu317_Cotton.ch.bit5_radarControl22;
//    SafeRadar_R.areaSign.bit.b2 = rtu317_Cotton.ch.bit6_radarControl23;
//    SafeRadar_R.areaSign.bit.b3 = rtu317_Cotton.ch.bit7_radarControl24;

//    SafeRadarControl_L = SafeRadar_L.areaSign.data & 0x07;

//    SafeRadar_L.areaSign.bit.b0 = rtu317_Cotton.ch.bit0_radarControl11;
//    SafeRadar_L.areaSign.bit.b1 = rtu317_Cotton.ch.bit1_radarControl12;
//    SafeRadar_L.areaSign.bit.b2 = rtu317_Cotton.ch.bit2_radarControl13;
//    SafeRadar_L.areaSign.bit.b3 = rtu317_Cotton.ch.bit3_radarControl14;

//    SafeRadarControl_R = SafeRadar_R.areaSign.data & 0x07;
  }
  else if(CarTypeStatus == 2)
  {
    control = qnode.io_send_IO.state;
    control = (qnode.io_send_IO.state >> 2) & 0x03;
    AgvInit = (qnode.io_send_IO.count & 0xffff);
    IO_motor_.read = qnode.io_send_IO.count >> 16;

    IO_stauts.state.data = qnode.io_send_IO.state;

    rtu317_CX.in.read = qnode.io_send_IO.in1 | (qnode.io_send_IO.in2 << 8);

  //    rtu3072.read = qnode.io_send_.in3 | (qnode.io_send_.in4 << 8);
  //    rtu317.read = qnode.io_send_.in1 | (qnode.io_send_.in2 << 8) | (qnode.io_send_.in3 << 16) | (qnode.io_send_.in4 << 24);
    rtu317_CX.out.write = qnode.io_send_IO.out1 | (qnode.io_send_IO.out2 << 8);
  //    errmask.cmd_id = qnode.io_send_.mask1 | (qnode.io_send_.mask2 << 8) | (qnode.io_send_.mask3 << 16) | (qnode.io_send_.mask4 << 24);

    ultr_data1 = qnode.io_send_ultr.in2 | (qnode.io_send_ultr.in1 << 8);
    ultr_data2 = qnode.io_send_ultr.in4 | (qnode.io_send_ultr.in3 << 8);
  }
  else if(CarTypeStatus == 3)
  {
    ControlStatus = qnode.io_send_.state;
    ControlStatus = (qnode.io_send_.state >> 2) & 0x03;
    AgvInit = (qnode.io_send_.count & 0xffff);
    IO_motor_.read = qnode.io_send_.count >> 16;

    IO_stauts.state.data = qnode.io_send_.state;


    rtu3170.in.read = qnode.io_send_.in1 | (qnode.io_send_.in2 << 8);
    rtu317e.in.read = qnode.io_send_.in3 | (qnode.io_send_.in4 << 8);

    rtu3170.out.write = qnode.io_send_.out1 | (qnode.io_send_.out2 << 8);
    rtu317e.out.write = qnode.io_send_.out3 | (qnode.io_send_.out4 << 8);
  }
  else if(CarTypeStatus == 4)
  {
    control = qnode.io_send_.state;
    control = (qnode.io_send_.state >> 2) & 0x03;
    AgvInit = qnode.io_send_.count;

    IO_stauts.state.data = qnode.io_send_.state;

    rtu3071.read = qnode.io_send_.in1 | (qnode.io_send_.in2 << 8);
    rtu3072.read = qnode.io_send_.in3 | (qnode.io_send_.in4 << 8);
    rtu317_Cotton.write = qnode.io_send_.out1 | (qnode.io_send_.out2 << 8) | (qnode.io_send_.out3 << 16) | (qnode.io_send_.out4 << 24);
//    errmask_Cotton_.mask.data = qnode.io_send_.mask1 | (qnode.io_send_.mask2 << 8) | (qnode.io_send_.mask3 << 16) | (qnode.io_send_.mask4 << 24);
    errmask_Cotton_.mask.b.impact = qnode.io_send_.mask1 & 0x01;

    int radarArea1011 = qnode.io_send_.mask3;
    int radarArea2011 = qnode.io_send_.mask4;

    if(radarArea1011 > 5)
    {
      errmask_Cotton_.mask.b.radarArea101 = 0;
    }
    else
    {
      errmask_Cotton_.mask.b.radarArea101 = radarArea1011;
    }

    if(radarArea2011 > 5)
    {
      errmask_Cotton_.mask.b.radarArea201 = 0;
    }
    else
    {
      errmask_Cotton_.mask.b.radarArea201 = radarArea2011;
    }

//    qDebug() << "errmask_cotton = " << errmask_Cotton_.mask.b.radarArea101;
//    errmask_Cotton_.mask.data = 255;

    SafeRadar_L.areaSign.bit.b0 = rtu3072.ch.bit4_radarSafeIn21;
    SafeRadar_L.areaSign.bit.b1 = rtu3072.ch.bit5_radarSafeIn22;
    SafeRadar_L.areaSign.bit.b2 = rtu3072.ch.bit6_radarSafeIn23;
    SafeRadar_L.areaSign.bit.b3 = rtu3072.ch.bit7_radarSafeIn24;

    SafeRadarStatus_L = SafeRadar_L.areaSign.data & 0x07;

    SafeRadar_R.areaSign.bit.b0 = rtu3072.ch.bit0_radarSafeIn11;
    SafeRadar_R.areaSign.bit.b1 = rtu3072.ch.bit1_radarSafeIn12;
    SafeRadar_R.areaSign.bit.b2 = rtu3072.ch.bit2_radarSafeIn13;
    SafeRadar_R.areaSign.bit.b3 = rtu3072.ch.bit3_radarSafeIn14;

    SafeRadarStatus_R = SafeRadar_R.areaSign.data & 0x07;

//    SafeRadar_R.areaSign.bit.b0 = rtu317_Cotton.ch.bit4_radarControl21;
//    SafeRadar_R.areaSign.bit.b1 = rtu317_Cotton.ch.bit5_radarControl22;
//    SafeRadar_R.areaSign.bit.b2 = rtu317_Cotton.ch.bit6_radarControl23;
//    SafeRadar_R.areaSign.bit.b3 = rtu317_Cotton.ch.bit7_radarControl24;

//    SafeRadarControl_L = SafeRadar_L.areaSign.data & 0x07;

//    SafeRadar_L.areaSign.bit.b0 = rtu317_Cotton.ch.bit0_radarControl11;
//    SafeRadar_L.areaSign.bit.b1 = rtu317_Cotton.ch.bit1_radarControl12;
//    SafeRadar_L.areaSign.bit.b2 = rtu317_Cotton.ch.bit2_radarControl13;
//    SafeRadar_L.areaSign.bit.b3 = rtu317_Cotton.ch.bit3_radarControl14;

//    SafeRadarControl_R = SafeRadar_R.areaSign.data & 0x07;

  }
  else if(CarTypeStatus == 5)
  {
    control = qnode.io_send_.state;
    control = (qnode.io_send_.state >> 2) & 0x03;
    AgvInit = qnode.io_send_.count;

    IO_stauts.state.data = qnode.io_send_.state;

    rtu_317f_s.in.data = qnode.io_send_.in1 | (qnode.io_send_.in2 << 8);
    rtu_317e_s.in.data = qnode.io_send_.in3;
    rtu_317f_s.out.data = qnode.io_send_.out1 | (qnode.io_send_.out2 << 8);
    rtu_317e_s.out.data = qnode.io_send_.out3 << 16;
//    errmask_Cotton_.mask.data = qnode.io_send_.mask1 | (qnode.io_send_.mask2 << 8) | (qnode.io_send_.mask3 << 16) | (qnode.io_send_.mask4 << 24);
    errmask_Cotton_.mask.b.impact = qnode.io_send_.mask1 & 0x01;

    int radarArea1011 = qnode.io_send_.mask3;
    int radarArea2011 = qnode.io_send_.mask4;

    if(radarArea1011 > 5)
    {
      errmask_Cotton_.mask.b.radarArea101 = 0;
    }
    else
    {
      errmask_Cotton_.mask.b.radarArea101 = radarArea1011;
    }

    if(radarArea2011 > 5)
    {
      errmask_Cotton_.mask.b.radarArea201 = 0;
    }
    else
    {
      errmask_Cotton_.mask.b.radarArea201 = radarArea2011;
    }

//    qDebug() << "errmask_cotton = " << errmask_Cotton_.mask.b.radarArea101;
//    errmask_Cotton_.mask.data = 255;

    SafeRadar_L.areaSign.bit.b0 = rtu3072.ch.bit4_radarSafeIn21;
    SafeRadar_L.areaSign.bit.b1 = rtu3072.ch.bit5_radarSafeIn22;
    SafeRadar_L.areaSign.bit.b2 = rtu3072.ch.bit6_radarSafeIn23;
    SafeRadar_L.areaSign.bit.b3 = rtu3072.ch.bit7_radarSafeIn24;

    SafeRadarStatus_L = SafeRadar_L.areaSign.data & 0x07;

    SafeRadar_R.areaSign.bit.b0 = rtu3072.ch.bit0_radarSafeIn11;
    SafeRadar_R.areaSign.bit.b1 = rtu3072.ch.bit1_radarSafeIn12;
    SafeRadar_R.areaSign.bit.b2 = rtu3072.ch.bit2_radarSafeIn13;
    SafeRadar_R.areaSign.bit.b3 = rtu3072.ch.bit3_radarSafeIn14;

    SafeRadarStatus_R = SafeRadar_R.areaSign.data & 0x07;

//    SafeRadar_R.areaSign.bit.b0 = rtu317_Cotton.ch.bit4_radarControl21;
//    SafeRadar_R.areaSign.bit.b1 = rtu317_Cotton.ch.bit5_radarControl22;
//    SafeRadar_R.areaSign.bit.b2 = rtu317_Cotton.ch.bit6_radarControl23;
//    SafeRadar_R.areaSign.bit.b3 = rtu317_Cotton.ch.bit7_radarControl24;

//    SafeRadarControl_L = SafeRadar_L.areaSign.data & 0x07;

//    SafeRadar_L.areaSign.bit.b0 = rtu317_Cotton.ch.bit0_radarControl11;
//    SafeRadar_L.areaSign.bit.b1 = rtu317_Cotton.ch.bit1_radarControl12;
//    SafeRadar_L.areaSign.bit.b2 = rtu317_Cotton.ch.bit2_radarControl13;
//    SafeRadar_L.areaSign.bit.b3 = rtu317_Cotton.ch.bit3_radarControl14;

//    SafeRadarControl_R = SafeRadar_R.areaSign.data & 0x07;

  }

}

//
void MainWindow::PcRobotStatusRunDecode()
{
  usb_robot_status_run_.cmd_id = qnode.usb_robot_status_run_re_.cmd_id;
  usb_robot_status_run_.status_brake = qnode.usb_robot_status_run_re_.brake;
  usb_robot_status_run_.agv_error.data = qnode.usb_robot_status_run_re_.agv_error;

//  pc_robot_status_run_.dev.data = qnode.pc_robot_status_run_re_.dev;
//  pc_robot_status_run_.logic.data = qnode.pc_robot_status_run_re_.logic;
}

void MainWindow::PcInfoDecode()
{
  pc_info_.pc_count = qnode.pc_info_re_.pc_count;
  from_arm_check_connection = pc_info_.pc_count;
//  qDebug("pc_inf", pc_info_.pc_count);
}

//屏幕与agv连接状态
void MainWindow::PcAgvScreenComStatus()
{
  from_pc_check_communication = qnode.communication_check_re_.from_pc_check_communication;

  PcAgvScreenComStatusCount++;
  if(PcAgvScreenComStatusCount % 10 == 0)
  {
    if(PcAgvScreenComStatusLast == from_pc_check_communication)
    {
      PcAgvScreenComStatusAlarm = 1;
    }
    else
    {
      PcAgvScreenComStatusAlarm = 0;
    }
    PcAgvScreenComStatusLast = from_pc_check_communication;
  }
}

void MainWindow::PcNetStatusDecode()
{
  from_pc_check_net_connection = qnode.network_info_re_.data;

  if(from_pc_check_net_connection == 1)
  {
    from_pc_check_net_connection_show++;
    checkCount = 1;
  }

  if(checkCount == 1)
  {
    from_pc_check_net_connection_show2++;
  }
}

void MainWindow::ArmRunInfoDecode()
{
  agv_rec_id_.agv_id = qnode.running_info_.agv_id;
  QString s = QString::fromStdString(qnode.running_info_.property);
  agv_rec_id_.property = qnode.running_info_.property;
  agv_rec_id_.agv_type = qnode.running_info_.agv_type;
//  std::string = qnode.running_info_.property;
//  QString s = QString::fromLocal8Bit(agv_rec_id_.agv_lines.c_str());
  agv_rec_id_.agv_lines = s.replace("\n", "");
  agv_rec_id_.agv_lines = agv_rec_id_.agv_lines.replace("_property", "");
  agv_rec_id_.agv_lines = agv_rec_id_.agv_lines.replace(" ", "");


//  agv_rec_id_.agv_lines = QString::fromLocal8Bit(agv_rec_id_.agv_lines);;
//  agv_loc_status = QString::fromStdString(qnode.running_info_.map_id);
  agv_loc_status = qnode.running_info_.status;        //机器人状态  0空闲1忙碌2建图

}

void MainWindow::GyroInfoDecode()
{
  gyro_s_.state.data = qnode.gyro_info_re_.state;
  gyro_s_.count = qnode.gyro_info_re_.count;
  gyro_s_.yaw = qnode.gyro_info_re_.yaw;
}

void MainWindow::MotorInfoDecode()
{
  Motor_re[0].serialNum = qnode.motor_info_re_Run[0].serialNum;
  Motor_re[0].state.data = qnode.motor_info_re_Run[0].state;
  Motor_re[0].current = qnode.motor_info_re_Run[0].current;
  Motor_re[0].voltage = qnode.motor_info_re_Run[0].voltage;
  Motor_re[0].temperature = qnode.motor_info_re_Run[0].temperature;
  Motor_re[0].data = qnode.motor_info_re_Run[0].data;
  Motor_re[0].errorCode = qnode.motor_info_re_Run[0].errorCode;
  Motor_re[0].count = qnode.motor_info_re_Run[0].count;
//  qDebug() << "ser = " << Motor_re[0].state.data;

  Motor_re[1].serialNum = qnode.motor_info_re_Run[1].serialNum;
  Motor_re[1].state.data = qnode.motor_info_re_Run[1].state;
  Motor_re[1].current = qnode.motor_info_re_Run[1].current;
  Motor_re[1].voltage = qnode.motor_info_re_Run[1].voltage;
  Motor_re[1].temperature = qnode.motor_info_re_Run[1].temperature;
  Motor_re[1].data = qnode.motor_info_re_Run[1].data;
  Motor_re[1].errorCode = qnode.motor_info_re_Run[1].errorCode;
  Motor_re[1].count = qnode.motor_info_re_Run[1].count;

  Motor_re[2].serialNum = qnode.motor_info_re_Run[2].serialNum;
  Motor_re[2].state.data = qnode.motor_info_re_Run[2].state;
  Motor_re[2].current = qnode.motor_info_re_Run[2].current;
  Motor_re[2].voltage = qnode.motor_info_re_Run[2].voltage;
  Motor_re[2].temperature = qnode.motor_info_re_Run[2].temperature;
  Motor_re[2].data = qnode.motor_info_re_Run[2].data;
  Motor_re[2].errorCode = qnode.motor_info_re_Run[2].errorCode;
  Motor_re[2].count = qnode.motor_info_re_Run[2].count;

//  qDebug("motor_re = %d", Motor_re[2].count);

  if(CarTypeStatus == 1)
  {
    Motor_re[3].serialNum = qnode.motor_info_re_Run[3].serialNum;
    Motor_re[3].state.data = qnode.motor_info_re_Run[3].state;
    Motor_re[3].current = qnode.motor_info_re_Run[3].current;
    Motor_re[3].voltage = qnode.motor_info_re_Run[3].voltage;
    Motor_re[3].temperature = qnode.motor_info_re_Run[3].temperature;
    Motor_re[3].data = qnode.motor_info_re_Run[3].data;
    Motor_re[3].errorCode = qnode.motor_info_re_Run[3].errorCode;
    Motor_re[3].count = qnode.motor_info_re_Run[3].count;

    Motor_re[4].serialNum = qnode.motor_info_re_Run[4].serialNum;
    Motor_re[4].state.data = qnode.motor_info_re_Run[4].state;
    Motor_re[4].current = qnode.motor_info_re_Run[4].current;
    Motor_re[4].voltage = qnode.motor_info_re_Run[4].voltage;
    Motor_re[4].temperature = qnode.motor_info_re_Run[4].temperature;
    Motor_re[4].data = qnode.motor_info_re_Run[4].data;
    Motor_re[4].errorCode = qnode.motor_info_re_Run[4].errorCode;
    Motor_re[4].count = qnode.motor_info_re_Run[4].count;

    Motor_re[5].serialNum = qnode.motor_info_re_Run[5].serialNum;
    Motor_re[5].state.data = qnode.motor_info_re_Run[5].state;
    Motor_re[5].current = qnode.motor_info_re_Run[5].current;
    Motor_re[5].voltage = qnode.motor_info_re_Run[5].voltage;
    Motor_re[5].temperature = qnode.motor_info_re_Run[5].temperature;
    Motor_re[5].data = qnode.motor_info_re_Run[5].data;
    Motor_re[5].errorCode = qnode.motor_info_re_Run[5].errorCode;
    Motor_re[5].count = qnode.motor_info_re_Run[5].count;
  }
  else if(CarTypeStatus == 2)
  {
    Motor_re[3].serialNum = qnode.motor_info_re_Run[3].serialNum;
    Motor_re[3].state.data = qnode.motor_info_re_Run[3].state;
    Motor_re[3].current = qnode.motor_info_re_Run[3].current;
    Motor_re[3].voltage = qnode.motor_info_re_Run[3].voltage;
    Motor_re[3].temperature = qnode.motor_info_re_Run[3].temperature;
    Motor_re[3].data = qnode.motor_info_re_Run[3].data;
    Motor_re[3].errorCode = qnode.motor_info_re_Run[3].errorCode;
    Motor_re[3].count = qnode.motor_info_re_Run[3].count;
  }
  else if(CarTypeStatus == 3)
  {
    Motor_re[3].serialNum = qnode.motor_info_re_Run[3].serialNum;
    Motor_re[3].state.data = qnode.motor_info_re_Run[3].state;
    Motor_re[3].current = qnode.motor_info_re_Run[3].current;
    Motor_re[3].voltage = qnode.motor_info_re_Run[3].voltage;
    Motor_re[3].temperature = qnode.motor_info_re_Run[3].temperature;
    Motor_re[3].data = qnode.motor_info_re_Run[3].data;
    Motor_re[3].errorCode = qnode.motor_info_re_Run[3].errorCode;
    Motor_re[3].count = qnode.motor_info_re_Run[3].count;

    Motor_re[4].serialNum = qnode.motor_info_re_Run[4].serialNum;
    Motor_re[4].state.data = qnode.motor_info_re_Run[4].state;
    Motor_re[4].current = qnode.motor_info_re_Run[4].current;
    Motor_re[4].voltage = qnode.motor_info_re_Run[4].voltage;
    Motor_re[4].temperature = qnode.motor_info_re_Run[4].temperature;
    Motor_re[4].data = qnode.motor_info_re_Run[4].data;
    Motor_re[4].errorCode = qnode.motor_info_re_Run[4].errorCode;
    Motor_re[4].count = qnode.motor_info_re_Run[4].count;

    Motor_re[5].serialNum = qnode.motor_info_re_Run[5].serialNum;
    Motor_re[5].state.data = qnode.motor_info_re_Run[5].state;
    Motor_re[5].current = qnode.motor_info_re_Run[5].current;
    Motor_re[5].voltage = qnode.motor_info_re_Run[5].voltage;
    Motor_re[5].temperature = qnode.motor_info_re_Run[5].temperature;
    Motor_re[5].data = qnode.motor_info_re_Run[5].data;
    Motor_re[5].errorCode = qnode.motor_info_re_Run[5].errorCode;
    Motor_re[5].count = qnode.motor_info_re_Run[5].count;
  }
}

void MainWindow::MissionInfoDecode()
{
//  agv_rec_id_.agv_lines = QString::fromStdString(qnode.running_info_.property);

    QString w;
    mission_info_.serverMissionId = qnode.mission_info_.serverMissionId;
    mission_info_.missionId = qnode.mission_info_.missiongId;
//    qDebug("%d",mission_info_.missionId);
    mission_info_.subMission = qnode.mission_info_.subMission;
    mission_info_.taskStartPoint = qnode.mission_info_.taskStartPoint;
    if(CarTypeStatus == 3)
    {
//      mission_info_.taskMidPoint = qnode.mission_info_.taskMidPoint;
    }
//    qDebug()<<"taskstartpoint = "<<mission_info_.taskStartPoint;
    mission_info_.taskStopPoint = qnode.mission_info_.taskStopPoint;
    mission_info_.taskType = QString::fromStdString(qnode.mission_info_.taskType);
    mission_info_.workQrValue = QString::fromStdString(qnode.mission_info_.workQrValue);
    mission_info_.callQrValue = QString::fromStdString(qnode.mission_info_.callQrValue);
    mission_info_.subMissionType = QString::fromStdString(qnode.mission_info_.subMissionType);
    mission_info_.missionName = qnode.mission_info_.missionName;
    mission_info_.missionInfo = qnode.mission_info_.missionInfo;

}

void MainWindow::MechanicalParametersDecode()
{
    mechanical_param_.robot_type = qnode.mech_param_.agv_type;
//    qDebug("agv_type = %d", mechanical_param_.robot_type);
    mechanical_param_.axis_length = qnode.mech_param_.axis_length;
    mechanical_param_.encoder_lines = qnode.mech_param_.encoder_lines;
    mechanical_param_.reduction_ratio = qnode.mech_param_.reduction_ratio;
    mechanical_param_.wheel_length = qnode.mech_param_.wheel_length;
    mechanical_param_.wheel_r = qnode.mech_param_.wheel_r;
}

void MainWindow::AgvSwStateDecode()
{
  agv_sw_state_.swState.data = qnode.agvsw_status_re_.sw;
  agv_sw_state_.state.data = qnode.agvsw_status_re_.state;
}

void MainWindow::SelfTaskInfoDecode()
{
  selftask_info_.selftaskName = qnode.selftask_info_re.selftaskName;
  selftask_info_.info = qnode.selftask_info_re.info;
}

void MainWindow::RemoteControlReDecde()
{
  Remote_Control_status = qnode.remote_control_re_.data;
}

void MainWindow::EcolineInfoReDecode()
{
  ecolineInfo_[0].value = qnode.ecoline_info_re_num_[0].value;
  ecolineInfo_[0].state.data = qnode.ecoline_info_re_num_[0].state;

  ecolineInfo_[1].value = qnode.ecoline_info_re_num_[1].value;
  ecolineInfo_[1].state.data = qnode.ecoline_info_re_num_[1].state;

  ecolineInfo_[2].value = qnode.ecoline_info_re_num_[2].value;
  ecolineInfo_[2].state.data = qnode.ecoline_info_re_num_[2].state;
}

/******************************************************************************/
/**********************************数据下发函数**********************************/
/******************************************************************************/
//任务完成数据下发函数
void MainWindow::ScreenOperateDataInfoSend()
{
  if(SureCancelStatus == 1)
  {
      qnode.load_upload_cargo_send_.agv_id = agv_rec_id_.agv_id;
      qnode.load_upload_cargo_send_.agv_type = agv_rec_id_.agv_type;
      qnode.load_upload_cargo_send_.property = agv_rec_id_.property;
      qnode.load_upload_cargo_send_.status = 1;
//      qDebug()<<qnode.load_upload_cargo_send_.agv_id<<qnode.load_upload_cargo_send_.status;
      qnode.LoadUploadCargoPulish(qnode.load_upload_cargo_send_);
      SureCancelStatus = 0;
  }
}

//停靠点定位函数
void MainWindow::quick_fixed_position_send_()
{
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 2;
//  qnode.quick_fixed_position_send_.
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);
}

void MainWindow::SendArmOpenCloseStopFun(int num)
{
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.arm_cmd_send_.cmd_id = timeT;
  qnode.arm_cmd_send_.cmd = 100;
  qnode.armcmdSendPublish(qnode.arm_cmd_send_);
//  if(num == 1)
//  {
//    qnode.qt_up_down_send_.cmd_id = timeT;
//    qnode.qt_up_down_send_.cmd = 3;
//    qnode.qt_up_down_send_.mode = 1;
//    qnode.qt_up_down_send_.param = 200;
//    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
//  }
//  else if(num == 2)
//  {
//    qnode.qt_up_down_send_.cmd_id = timeT;
//    qnode.qt_up_down_send_.cmd = 3;
//    qnode.qt_up_down_send_.mode = 1;
//    qnode.qt_up_down_send_.param = 210;
//    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
//  }
}

void MainWindow::SendArmOpenFun(int num)
{
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

//  qnode.arm_cmd_send_.cmd_id = timeT;
//  qnode.arm_cmd_send_.cmd = 101;
//  qnode.armcmdSendPublish(qnode.arm_cmd_send_);

  if(num == 1)
  {
    qnode.qt_up_down_send_.cmd_id = timeT;
    qnode.qt_up_down_send_.cmd = 3;
    qnode.qt_up_down_send_.mode = 1;
    qnode.qt_up_down_send_.param = 201;
    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
  }
  else if(num == 2)
  {
    qnode.qt_up_down_send_.cmd_id = timeT;
    qnode.qt_up_down_send_.cmd = 3;
    qnode.qt_up_down_send_.mode = 1;
    qnode.qt_up_down_send_.param = 211;
    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
  }

}

void MainWindow::SendArmCloseFun(int num)
{
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

//  qnode.arm_cmd_send_.cmd_id = timeT;
//  qnode.arm_cmd_send_.cmd = 102;
//  qnode.armcmdSendPublish(qnode.arm_cmd_send_);
  if(num == 1)
  {
    qnode.qt_up_down_send_.cmd_id = timeT;
    qnode.qt_up_down_send_.cmd = 3;
    qnode.qt_up_down_send_.mode = 1;
    qnode.qt_up_down_send_.param = 202;
    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
  }
  else if(num == 2)
  {
    qnode.qt_up_down_send_.cmd_id = timeT;
    qnode.qt_up_down_send_.cmd = 3;
    qnode.qt_up_down_send_.mode = 1;
    qnode.qt_up_down_send_.param = 212;
    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
  }
}

void MainWindow::SendRebootAgvFun()
{
  qnode.reboot_agv_send_.data = 1;
  qnode.rebootAgvSendPublish(qnode.reboot_agv_send_);
}

void MainWindow::SendErrorMaskSysFun()
{
//    qnode.errmask_send_.mask = errmask.mask.data;
//    qnode.errmaskSendPublish(qnode.errmask_send_);
}

/**************************************************************************/
/************************按钮动作函数****************************************/
/**************************************************************************/

//完成任务按钮
void MainWindow::on_LoadingBtn_clicked()
{
  Q_EMIT AlarmWaining(16);
}

//取消任务按钮
void MainWindow::on_DischargeBtn_clicked()
{
  Q_EMIT AlarmWaining(17);
}

//盘库界面按钮按下
void MainWindow::on_NumberCount_pressed()
{
  ui.NumberCount->setIcon(QIcon(":/image/4dai/numbergreen.png"));
  ui.NumberCount->setIconSize(QSize(217,67));
}

//盘库界面按钮抬起
void MainWindow::on_NumberCount_released()
{
  ui.NumberCount->setIcon(QIcon(":/image/4dai/numberbule.png"));
  ui.NumberCount->setIconSize(QSize(217,67));

  QString http = "http://";
//  QString IP1 = "192.168.0.1";
  QString index = "/cleanerSingleScreen.html?agvId=1";
  QString app = getIP+index;

  QDesktopServices::openUrl(QUrl(app));

}

void MainWindow::on_OpenNet_pressed()
{
  ui.OpenNet->setIcon(QIcon(":/image/chache/NetCheckgreen.png"));
  ui.OpenNet->setIconSize(QSize(217,67));
}

void MainWindow::on_OpenNet_released()
{
  ui.OpenNet->setIcon(QIcon(":/image/chache/NetCheckblue.png"));
  ui.OpenNet->setIconSize(QSize(217,67));

  QString http = "http://";
//  QString IP1 = "192.168.0.1";
//  QString index = "/pb/#/";
  QString app = http + getNetIP;

  QDesktopServices::openUrl(QUrl(app));
}

//返回主界面按钮
void MainWindow::on_Mainwindowshow_clicked()
{
  QString word_str1;
  QPalette color;
  QFont font;

  ui.stackedWidget->setCurrentWidget(ui.page);

  ui.Mainwindowshow->setIcon(QIcon(":/image/main1.png"));
  ui.Alarm->setIcon(QIcon(":/image/alarm2"));
  ui.Parametershow->setIcon(QIcon(":/image/par2"));
  ui.System->setIcon(QIcon(":/image/sys2"));
//  if(CarTypeStatus == 1)
//  {
//    ui.LoadingBtn->hide();
//    ui.DischargeBtn->hide();
//    ui.CancelPosition->show();
//    ui.FixPosition->show();
//    ui.FixPosition_label->show();
//    ui.FixPosition_12->show();
//    ui.FixPosition_12_label->show();
//    ui.RobotBack->setGeometry(230, 70, 382,448);
//    ui.Position->setGeometry(150, 90, 330, 28);

//    if(PositionMode == 0)
//    {
//      ui.FixPosition_12->hide();
//      ui.FixPosition_12_label->hide();

//      font.setPointSize(WARNING_WORD_SIZE_26);
//      word_str1 = QString::fromLocal8Bit("停靠点定位");
//      ui.FixPosition_label->setFont(font);
//      ui.FixPosition_label->setText(QString(word_str1));                //显示页数
//      ui.FixPosition_label->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.FixPosition_label->setPalette(color);
//    }
//    else
//    {
//      ui.FixPosition_12->show();
//      ui.FixPosition_12_label->show();

//      font.setPointSize(WARNING_WORD_SIZE_26);
//      word_str1 = QString::fromLocal8Bit("充电点定位");
//      ui.FixPosition_label->setFont(font);
//      ui.FixPosition_label->setText(QString(word_str1));                //显示页数
//      ui.FixPosition_label->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.FixPosition_label->setPalette(color);
//    }
//  }
//  else if(CarTypeStatus == 2)
//  {
//    ui.Motor5Alarm->hide();
//    ui.ObstacleAlarm->hide();
//    ui.BatteryLow->hide();
//    ui.impact->hide();
//    ui.LoadingBtn->hide();
//    ui.DischargeBtn->hide();
//    ui.CancelPosition->show();
//    ui.FixPosition->show();
//    ui.FixPosition_label->show();
//    ui.FixPosition_12->show();
//    ui.FixPosition_12_label->show();
//    ui.RobotBack->setGeometry(230, 70, 382,448);
//    ui.Position->setGeometry(150, 90, 330, 28);
//  }
//  else if(CarTypeStatus == 3)
//  {
//    ui.Position->hide();
//    ui.Motor5Alarm->hide();
//    ui.ObstacleAlarm->hide();
//    ui.BatteryLow->hide();
//    ui.impact->hide();
//    ui.CancelPosition->show();
//    ui.FixPosition->show();
//    ui.FixPosition_label->show();
//    ui.FixPosition_12->show();
//    ui.FixPosition_12_label->show();
//    ui.RobotBack->setGeometry(230, 70, 382,448);
//    ui.Position->setGeometry(150, 90, 330, 28);
//  }
//  else if(CarTypeStatus == 4 || CarTypeStatus == 5)
  {
    ui.Motor5Alarm->hide();
    ui.BatteryLow->hide();
    ui.LoadingBtn->hide();
    ui.DischargeBtn->hide();
//    ui.FixPosition->hide();
//    ui.FixPosition_label->hide();
//    ui.FixPosition_12->hide();
//    ui.FixPosition_12_label->hide();
    ui.CancelPosition->hide();
    ui.RobotBack->setGeometry(230, 70, 382,448);
    ui.Position->setGeometry(50, 140, 230, 28);
    ui.FixPosition->setGeometry(10, 200, 217, 67);
    ui.FixPosition_label->setGeometry(10, 200, 217, 67);

    ui.FixPosition_12->show();
    ui.FixPosition_12_label->show();

    font.setPointSize(WARNING_WORD_SIZE_26);
    word_str1 = QString::fromLocal8Bit("充电点定位");
    ui.FixPosition_label->setFont(font);
    ui.FixPosition_label->setText(QString(word_str1));                //显示页数
    ui.FixPosition_label->setAlignment(Qt::AlignCenter);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.FixPosition_label->setPalette(color);
  }

//  ui.CancelPosition->show();
  ui.FixPosition->show();
  ui.CancelTask->show();
  ui.ManualBrake->show();
  ui.ManualRecover->show();
}

//警报显示按钮
void MainWindow::on_Alarm_clicked()
{
  if(CarTypeStatus == 1)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_2);

    if(motorNumMode == 0)
    {
      ui.Motor6_name_label->hide();
      ui.Motor6->hide();
      ui.Motor6Btu->hide();
    }
  }
  else if(CarTypeStatus == 2)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_9);
  }
  else if(CarTypeStatus == 3)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_11);
  }
  else if(CarTypeStatus == 4 || CarTypeStatus == 5)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_15);
  }

  ui.Mainwindowshow->setIcon(QIcon(":/image/main2.png"));
  ui.Alarm->setIcon(QIcon(":/image/alarm1"));
  ui.Parametershow->setIcon(QIcon(":/image/par2"));
  ui.System->setIcon(QIcon(":/image/sys2"));

  ui.CancelPosition->hide();
  ui.FixPosition->hide();
  ui.CancelTask->hide();
  ui.ManualBrake->hide();
  ui.ManualRecover->hide();
}

//参数显示按钮
void MainWindow::on_Parametershow_clicked()
{
  if(CarTypeStatus == 1)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_3);

//    if(PositionMode == 0)
//    {
//      ui.FixPosition_2->hide();
//      ui.FixPosition_2_label->hide();
//      ui.FixPosition_3->hide();
//      ui.FixPosition_3_label->hide();
//      ui.FixPosition_4->hide();
//      ui.FixPosition_4_label->hide();
//      ui.FixPosition_5->hide();
//      ui.FixPosition_5_label->hide();
//      ui.FixPosition_6->hide();
//      ui.FixPosition_6_label->hide();
//      ui.FixPosition_7->hide();
//      ui.FixPosition_7_label->hide();
//      ui.FixPosition_8->hide();
//      ui.FixPosition_8_label->hide();
//      ui.FixPosition_9->hide();
//      ui.FixPosition_9_label->hide();
//      ui.FixPosition_10->hide();
//      ui.FixPosition_10_label->hide();
//      ui.FixPosition_11->hide();
//      ui.FixPosition_11_label->hide();

//      ui.InlimitTitle->setGeometry(40, 200, 190, 40);
//      ui.Inlimit->setGeometry(230, 200, 151, 40);
//      ui.Inlimit_2->setGeometry(230, 200, 151, 40);

//      ui.InArriveTitle->setGeometry(40, 260, 190, 40);
//      ui.InArrive->setGeometry(230, 260, 151, 40);
//      ui.InArrive_2->setGeometry(230, 260, 151, 40);

//      ui.Door1Title->setGeometry(40, 320, 190, 40);
//      ui.Door1->setGeometry(230, 320, 151, 40);
//      ui.Door1_2->setGeometry(230, 320, 151, 40);

//      ui.OutLimmitTitle->setGeometry(480, 200, 190, 40);
//      ui.OutLimmit->setGeometry(670, 200, 151, 40);
//      ui.OutLimmit_2->setGeometry(670, 200, 151, 40);

//      ui.OutArriveTitle->setGeometry(480, 260, 190, 40);
//      ui.OutArrive->setGeometry(670, 260, 151, 40);
//      ui.OutArrive_2->setGeometry(670, 260, 151, 40);

//      ui.TouchTitle->setGeometry(910, 200, 190, 40);
//      ui.Touch->setGeometry(1100, 200, 151, 40);
//      ui.Touch_2->setGeometry(1100, 200, 151, 40);

//      ui.DropTitle->setGeometry(910, 260, 190, 40);
//      ui.Drop->setGeometry(1100, 260, 151, 40);
//      ui.Drop_2->setGeometry(1100, 260, 151, 40);

//    }
//    if(PositionMode == 1)
//    {
//      ui.FixPosition_2->show();
//      ui.FixPosition_2_label->show();
//      ui.FixPosition_3->show();
//      ui.FixPosition_3_label->show();
//      ui.FixPosition_4->show();
//      ui.FixPosition_4_label->show();
//      ui.FixPosition_5->show();
//      ui.FixPosition_5_label->show();
//      ui.FixPosition_6->show();
//      ui.FixPosition_6_label->show();
//      ui.FixPosition_7->show();
//      ui.FixPosition_7_label->show();
//      ui.FixPosition_8->show();
//      ui.FixPosition_8_label->show();
//      ui.FixPosition_9->show();
//      ui.FixPosition_9_label->show();
//      ui.FixPosition_10->show();
//      ui.FixPosition_10_label->show();
//      ui.FixPosition_11->show();
//      ui.FixPosition_11_label->show();

//      ui.InlimitTitle->setGeometry(40, 80, 190, 40);
//      ui.Inlimit->setGeometry(230, 80, 151, 40);
//      ui.Inlimit_2->setGeometry(230, 80, 151, 40);

//      ui.InArriveTitle->setGeometry(40, 140, 190, 40);
//      ui.InArrive->setGeometry(230, 140, 151, 40);
//      ui.InArrive_2->setGeometry(230, 140, 151, 40);

//      ui.Door1Title->setGeometry(40, 200, 190, 40);
//      ui.Door1->setGeometry(230, 200, 151, 40);
//      ui.Door1_2->setGeometry(230, 200, 151, 40);

//      ui.OutLimmitTitle->setGeometry(480, 80, 190, 40);
//      ui.OutLimmit->setGeometry(670, 80, 151, 40);
//      ui.OutLimmit_2->setGeometry(670, 80, 151, 40);

//      ui.OutArriveTitle->setGeometry(480, 140, 190, 40);
//      ui.OutArrive->setGeometry(670, 140, 151, 40);
//      ui.OutArrive_2->setGeometry(670, 140, 151, 40);

//      ui.TouchTitle->setGeometry(910, 80, 190, 40);
//      ui.Touch->setGeometry(1100, 80, 151, 40);
//      ui.Touch_2->setGeometry(1100, 80, 151, 40);

//      ui.DropTitle->setGeometry(910, 140, 190, 40);
//      ui.Drop->setGeometry(1100, 140, 151, 40);
//      ui.Drop_2->setGeometry(1100, 140, 151, 40);
//    }

  }
  else if(CarTypeStatus == 2)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_10);
  }
  else if(CarTypeStatus == 3)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_12);
  }
  else if(CarTypeStatus == 4 )
  {
    ui.stackedWidget->setCurrentWidget(ui.page_16);
  }
  else if(CarTypeStatus == 5)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_8);
  }

  ui.Mainwindowshow->setIcon(QIcon(":/image/main2.png"));
  ui.Alarm->setIcon(QIcon(":/image/alarm2"));
  ui.Parametershow->setIcon(QIcon(":/image/par1"));
  ui.System->setIcon(QIcon(":/image/sys2"));

  ui.CancelPosition->hide();
  ui.FixPosition->hide();
  ui.CancelTask->hide();
  ui.ManualBrake->hide();
  ui.ManualRecover->hide();
}

//系统显示按钮
void MainWindow::on_System_clicked()
{
//  ui.stackedWidget->setCurrentWidget(ui.page_4);

//  if(CarTypeStatus == 4 || CarTypeStatus == 5)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_17);
  }

  ui.Mainwindowshow->setIcon(QIcon(":/image/main2.png"));
  ui.Alarm->setIcon(QIcon(":/image/alarm2"));
  ui.Parametershow->setIcon(QIcon(":/image/par2"));
  ui.System->setIcon(QIcon(":/image/sys1"));

  ui.CancelPosition->hide();
  ui.FixPosition->hide();
  ui.CancelTask->hide();
  ui.ManualBrake->hide();
  ui.ManualRecover->hide();
}

//电池参数显示按钮
void MainWindow::on_BatteryParashow_clicked()
{
    ui.stackedWidget->setCurrentWidget(ui.page_5);

    ui.Mainwindowshow->setIcon(QIcon(":/image/main2.png"));
    ui.Alarm->setIcon(QIcon(":/image/alarm2"));
    ui.Parametershow->setIcon(QIcon(":/image/par2"));
    ui.System->setIcon(QIcon(":/image/sys2"));

    ui.CancelPosition->hide();
    ui.FixPosition->hide();
    ui.CancelTask->hide();
    ui.ManualBrake->hide();
    ui.ManualRecover->hide();
}

//电机参数显示按钮
void MainWindow::on_MotorParashow_clicked()
{
  if(CarTypeStatus == 1 || CarTypeStatus == 2)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_6);
  }
  else if(CarTypeStatus == 3)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_13);
  }

    ui.Mainwindowshow->setIcon(QIcon(":/image/main2.png"));
    ui.Alarm->setIcon(QIcon(":/image/alarm2"));
    ui.Parametershow->setIcon(QIcon(":/image/par2"));
    ui.System->setIcon(QIcon(":/image/sys2"));

    ui.CancelPosition->hide();
    ui.FixPosition->hide();
    ui.CancelTask->hide();
    ui.ManualBrake->hide();
    ui.ManualRecover->hide();
}


void MainWindow::on_MotorParashow_Ma_clicked()
{
  ui.stackedWidget->setCurrentWidget(ui.page_6);

  ui.Mainwindowshow->setIcon(QIcon(":/image/main2.png"));
  ui.Alarm->setIcon(QIcon(":/image/alarm2"));
  ui.Parametershow->setIcon(QIcon(":/image/par2"));
  ui.System->setIcon(QIcon(":/image/sys2"));

  ui.CancelPosition->hide();
  ui.FixPosition->hide();
  ui.CancelTask->hide();
  ui.ManualBrake->hide();
  ui.ManualRecover->hide();
}


//重启界面显示按钮
void MainWindow::on_DebugShow_clicked()
{
  if(CarTypeStatus == 1)
  {
    if(CarTypeMode == 1)
    {
      ui.stackedWidget->setCurrentWidget(ui.page_7);
      ui.RebootWin_7->hide();
      ui.ArmGuradGetBtn->hide();
      ui.ArmGuradPutBtn->hide();
      ui.ArmGuradGetPutBtn->hide();
      ui.LoadingBtn->hide();
      ui.DischargeBtn->hide();
      ui.RebootWin_4->hide();
      ui.ArmPushBtn->hide();
      ui.ArmPullBtn->hide();
      ui.ArmPullPushBtn->hide();
      ui.RebootWin_5->hide();
      ui.ArmPutBtn->hide();
      ui.ArmGetBtn->hide();
      ui.ArmPutGetBtn->hide();

      ui.textBrowser->setGeometry(870, 120, 370, 330);
      ui.RebootWin_1->setGeometry(90, 80, 121, 40);
      ui.RebootAgv->setGeometry(210, 70, 161, 50);

      ui.RebootWin_2->setGeometry(90,150, 121, 40);
      ui.OpenNet->setGeometry(210, 150 , 161, 50);

      ui.RebootWin_8->setGeometry(70, 230, 141, 40);
      ui.ImpactControlOpen->setGeometry(230, 230, 161, 50);
      ui.ImpactControlClose->setGeometry(400, 230, 161, 51);

      ui.RebootWin_6->setGeometry(90, 310, 121, 40);
      ui.LedRealtimeOpenBtn->setGeometry(210, 300, 161, 50);
      ui.LedCustomizOpenBtn->setGeometry(380, 300, 161, 50);
      ui.LedCloseBtn->setGeometry(550, 300, 161, 51);

      ui.RebootWin_3->setGeometry(90,380,121,40);
      ui.ArmOpenBtn->setGeometry(210,380, 161, 50);
      ui.ArmCloseBtn->setGeometry(380, 380, 161, 50);
      ui.ArmOpenCloseStopBtn->setGeometry(550, 380, 161, 50);
    }
    else if(CarTypeMode == 2)
    {
      ui.stackedWidget->setCurrentWidget(ui.page_7);
      ui.RebootWin_7->hide();
      ui.ArmGuradGetBtn->hide();
      ui.ArmGuradPutBtn->hide();
      ui.ArmGuradGetPutBtn->hide();
      ui.LoadingBtn->hide();
      ui.DischargeBtn->hide();

      ui.textBrowser->setGeometry(870, 120, 370, 330);
      ui.RebootWin_1->setGeometry(90, 40, 121, 40);
      ui.RebootAgv->setGeometry(210, 30, 161, 50);

      ui.RebootWin_2->setGeometry(90,100, 121, 40);
      ui.OpenNet->setGeometry(210, 100 , 161, 50);

      ui.RebootWin_8->setGeometry(70, 170, 141, 40);
      ui.ImpactControlOpen->setGeometry(230, 170, 161, 50);
      ui.ImpactControlClose->setGeometry(400, 170, 161, 51);

      ui.RebootWin_6->setGeometry(90, 240, 121, 40);
      ui.LedRealtimeOpenBtn->setGeometry(210, 230, 161, 50);
      ui.LedCustomizOpenBtn->setGeometry(380, 230, 161, 50);
      ui.LedCloseBtn->setGeometry(550, 230, 161, 51);

      ui.RebootWin_3->setGeometry(90,300,121,40);
      ui.ArmOpenBtn->setGeometry(210,300, 161, 50);
      ui.ArmCloseBtn->setGeometry(380, 300, 161, 50);
      ui.ArmOpenCloseStopBtn->setGeometry(550, 300, 161, 50);

      ui.RebootWin_4->show();
      ui.ArmPushBtn->show();
      ui.ArmPullBtn->show();
      ui.ArmPullPushBtn->show();
      ui.RebootWin_5->show();
      ui.ArmPutBtn->show();
      ui.ArmGetBtn->show();
      ui.ArmPutGetBtn->show();
    }

  }
  else if(CarTypeStatus == 2)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_7);
    ui.RebootWin_7->hide();
    ui.ArmGuradGetBtn->hide();
    ui.ArmGuradPutBtn->hide();
    ui.ArmGuradGetPutBtn->hide();
    ui.LoadingBtn->hide();
    ui.DischargeBtn->hide();

//    ui.RebootWin_4->show();
//    ui.ArmPushBtn->show();
//    ui.ArmPullBtn->show();
//    ui.ArmPullPushBtn->show();
//    ui.RebootWin_5->show();
//    ui.ArmPutBtn->show();
//    ui.ArmGetBtn->show();
//    ui.ArmPutGetBtn->show();
  }
  else if(CarTypeStatus == 3)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_7);
  }
  else if(CarTypeStatus == 4 || CarTypeStatus == 5)
  {
    return;
  }

  ui.Mainwindowshow->setIcon(QIcon(":/image/main2.png"));
  ui.Alarm->setIcon(QIcon(":/image/alarm2"));
  ui.Parametershow->setIcon(QIcon(":/image/par2"));
  ui.System->setIcon(QIcon(":/image/sys2"));

  if(ledStatus == 0)
  {
    ui.LedRealtimeOpenBtn->setIcon(QIcon(":/image/chache/led/realtimeledblue.png"));
    ui.LedCustomizOpenBtn->setIcon(QIcon(":/image/chache/led/customizeledblue.png"));
    ui.LedCloseBtn->setIcon(QIcon(":/image/chache/led/closeledgreen.png"));
  }
  else if(ledStatus == 1)
  {
    ui.LedRealtimeOpenBtn->setIcon(QIcon(":/image/chache/led/realtimeledgreen.png"));
    ui.LedCustomizOpenBtn->setIcon(QIcon(":/image/chache/led/customizeledblue.png"));
    ui.LedCloseBtn->setIcon(QIcon(":/image/chache/led/closeledblue.png"));
  }
  else if(ledStatus == 2)
  {
    ui.LedRealtimeOpenBtn->setIcon(QIcon(":/image/chache/led/realtimeledblue.png"));
    ui.LedCustomizOpenBtn->setIcon(QIcon(":/image/chache/led/customizeledgreen.png"));
    ui.LedCloseBtn->setIcon(QIcon(":/image/chache/led/closeledblue.png"));
  }

  ui.CancelPosition->hide();
  ui.FixPosition->hide();
  ui.CancelTask->hide();
  ui.ManualBrake->hide();
  ui.ManualRecover->hide();
}

//电池界面关闭按钮
void MainWindow::on_BatteryReturn_clicked()
{
  ui.stackedWidget->setCurrentWidget(ui.page);

  ui.Mainwindowshow->setIcon(QIcon(":/image/main1.png"));
  ui.Alarm->setIcon(QIcon(":/image/alarm2"));
  ui.Parametershow->setIcon(QIcon(":/image/par2"));
  ui.System->setIcon(QIcon(":/image/sys2"));

  ui.CancelPosition->show();
  ui.FixPosition->show();
  ui.CancelTask->show();
  ui.ManualBrake->show();
  ui.ManualRecover->show();
}

//电机界面关闭按钮
void MainWindow::on_MotorReturn_clicked()
{
  if(CarTypeStatus == 1)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_2);
  }
  else if(CarTypeStatus == 2)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_9);
  }
  else if(CarTypeStatus == 4 || CarTypeStatus == 5)
  {
    ui.stackedWidget->setCurrentWidget(ui.page_15);
  }

  ui.Mainwindowshow->setIcon(QIcon(":/image/main2.png"));
  ui.Alarm->setIcon(QIcon(":/image/alarm1"));
  ui.Parametershow->setIcon(QIcon(":/image/par2"));
  ui.System->setIcon(QIcon(":/image/sys2"));

  ui.CancelPosition->hide();
  ui.FixPosition->hide();
  ui.CancelTask->hide();
  ui.ManualBrake->hide();
  ui.ManualRecover->hide();
}

//重启界面关闭按钮
void MainWindow::on_DebugReturn_clicked()
{
  ui.stackedWidget->setCurrentWidget(ui.page);

  ui.Mainwindowshow->setIcon(QIcon(":/image/main1.png"));
  ui.Alarm->setIcon(QIcon(":/image/alarm2"));
  ui.Parametershow->setIcon(QIcon(":/image/par2"));
  ui.System->setIcon(QIcon(":/image/sys2"));

  ui.CancelPosition->show();
  ui.FixPosition->show();
  ui.CancelTask->show();
  ui.ManualBrake->show();
  ui.ManualRecover->show();
}

//机器人重启按钮
void MainWindow::on_RebootAgv_pressed()
{
  ui.RebootAgv->setIcon(QIcon(":/image/4dai/reboot.png"));
  ui.RebootAgv->setIconSize(QSize(217,67));
}

//机器人重启按钮
void MainWindow::on_RebootAgv_released()
{
  ui.RebootAgv->setIcon(QIcon(":/image/4dai/rebootblue.png"));
  ui.RebootAgv->setIconSize(QSize(217,67));

  qnode.reboot_agv_send_.data = 1;
  qnode.rebootAgvSendPublish(qnode.reboot_agv_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("机器人重启按钮!!!");
  errorLocalLogInfoDecode(word_str);
}

//左侧平台上升
void MainWindow::on_ArmOpenBtn_pressed()
{
  ui.ArmOpenBtn->setIcon(QIcon(":/image/chache/openarmgreen.png"));
  ui.ArmOpenBtn->setIconSize(QSize(217,67));
}
//左侧平台上升
void MainWindow::on_ArmOpenBtn_released()
{
  ui.ArmOpenBtn->setIcon(QIcon(":/image/chache/openarmblue.png"));
  ui.ArmOpenBtn->setIconSize(QSize(217,67));

//  Q_EMIT ArmOpenCmdSend(1);
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.arm_cmd_send_.cmd_id = timeT;
  qnode.arm_cmd_send_.cmd = 101;
  qnode.armcmdSendPublish(qnode.arm_cmd_send_);

//    qnode.qt_up_down_send_.cmd_id = timeT;
//    qnode.qt_up_down_send_.cmd = 3;
//    qnode.qt_up_down_send_.mode = 1;
//    qnode.qt_up_down_send_.param = 101;
//    qnode.QtUpDownPublish(qnode.qt_up_down_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("操作抱手伸出按钮!!!");
  errorLocalLogInfoDecode(word_str);
}

//左侧平台下降
void MainWindow::on_ArmCloseBtn_pressed()
{
  ui.ArmCloseBtn->setIcon(QIcon(":/image/chache/closearmgreen.png"));
  ui.ArmCloseBtn->setIconSize(QSize(217,67));
}
//左侧平台下降
void MainWindow::on_ArmCloseBtn_released()
{
  ui.ArmCloseBtn->setIcon(QIcon(":/image/chache/closearmblue.png"));
  ui.ArmCloseBtn->setIconSize(QSize(217,67));


//  Q_EMIT ArmCloseCmdSend(1);
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.arm_cmd_send_.cmd_id = timeT;
  qnode.arm_cmd_send_.cmd = 102;
  qnode.armcmdSendPublish(qnode.arm_cmd_send_);

//    qnode.qt_up_down_send_.cmd_id = timeT;
//    qnode.qt_up_down_send_.cmd = 3;
//    qnode.qt_up_down_send_.mode = 1;
//    qnode.qt_up_down_send_.param = 102;
//    qnode.QtUpDownPublish(qnode.qt_up_down_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("操作抱手缩回按钮!!!");
  errorLocalLogInfoDecode(word_str);

}

//左侧平台暂停
void MainWindow::on_ArmOpenCloseStopBtn_pressed()
{
  ui.ArmOpenCloseStopBtn->setIcon(QIcon(":/image/chache/pausegreen.png"));
  ui.ArmOpenCloseStopBtn->setIconSize(QSize(217,67));
}
//左侧平台暂停
void MainWindow::on_ArmOpenCloseStopBtn_released()
{
  ui.ArmOpenCloseStopBtn->setIcon(QIcon(":/image/4dai/pausearmred.png"));
  ui.ArmOpenCloseStopBtn->setIconSize(QSize(217,67));

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.arm_cmd_send_.cmd_id = timeT;
  qnode.arm_cmd_send_.cmd = 100;
  qnode.armcmdSendPublish(qnode.arm_cmd_send_);

//    qnode.qt_up_down_send_.cmd_id = timeT;
//    qnode.qt_up_down_send_.cmd = 3;
//    qnode.qt_up_down_send_.mode = 1;
//    qnode.qt_up_down_send_.param = 200;
//    qnode.QtUpDownPublish(qnode.qt_up_down_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("操作抱手暂停按钮!!!");
  errorLocalLogInfoDecode(word_str);

}

//void MainWindow::on_ImpactControlOpen_clicked()
//{
//  errmask.mask.b.impact = 1;
//  ui.ImpactControlOpen->setIcon(QIcon(":/image/chache/OpenGreen.png"));
//  ui.ImpactControlClose->setIcon(QIcon(":/image/chache/CloseBlue.png"));

//  qnode.errmask_send_.mask = errmask.mask.data;
//  qnode.errmaskSendPublish(qnode.errmask_send_);
//}

//void MainWindow::on_ImpactControlClose_clicked()
//{
//  errmask.mask.b.impact = 0;
//  ui.ImpactControlOpen->setIcon(QIcon(":/image/chache/OpenBlue.png"));
//  ui.ImpactControlClose->setIcon(QIcon(":/image/chache/CloseRed.png"));

//  qnode.errmask_send_.mask = errmask.mask.data;
//  qnode.errmaskSendPublish(qnode.errmask_send_);
//}

//1实时显示  2自定义
void MainWindow::on_LedRealtimeOpenBtn_pressed()
{
  SetLedStatus(1, 10);
  ui.LedRealtimeOpenBtn->setIcon(QIcon(":/image/chache/led/realtimeledgreen.png"));
}

void MainWindow::on_LedRealtimeOpenBtn_released()
{
  ui.LedRealtimeOpenBtn->setIcon(QIcon(":/image/chache/led/realtimeledgreen.png"));
  ui.LedCustomizOpenBtn->setIcon(QIcon(":/image/chache/led/customizeledblue.png"));
  ui.LedCloseBtn->setIcon(QIcon(":/image/chache/led/closeledblue.png"));

  QString word_str;
  word_str = QString::fromLocal8Bit("led切换为实时模式!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_LedCustomizOpenBtn_pressed()
{
  SetLedStatus(2, 10);
  ui.LedCustomizOpenBtn->setIcon(QIcon(":/image/chache/led/customizeledgreen.png"));
}

void MainWindow::on_LedCustomizOpenBtn_released()
{
  ui.LedRealtimeOpenBtn->setIcon(QIcon(":/image/chache/led/realtimeledblue.png"));
  ui.LedCloseBtn->setIcon(QIcon(":/image/chache/led/closeledblue.png"));

  QString word_str;
  word_str = QString::fromLocal8Bit("led切换为自定义模式!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_LedCloseBtn_pressed()
{
  SetLedStatus(0, 10);
  ui.LedCloseBtn->setIcon(QIcon(":/image/chache/led/closeledgreen.png"));
}

void MainWindow::on_LedCloseBtn_released()
{
  ui.LedRealtimeOpenBtn->setIcon(QIcon(":/image/chache/led/realtimeledblue.png"));
  ui.LedCustomizOpenBtn->setIcon(QIcon(":/image/chache/led/customizeledblue.png"));

  QString word_str;
  word_str = QString::fromLocal8Bit("led关闭!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_CarTypeBSMotor5_clicked()
{
    SetLedStatus(10, 1);
}


void MainWindow::on_CarTypeBSMotor6_clicked()
{
    SetLedStatus(10, 2);
}

void MainWindow::on_CarTypeCXMotor4_clicked()
{
    SetLedStatus(10, 3);
}

void MainWindow::on_CarTypeMBmotor3_clicked()
{
    SetLedStatus(10, 5);
}


void MainWindow::on_CarTypeBZDMotor6_clicked()
{
    SetLedStatus(10, 6);
}

void MainWindow::on_CarTypeDCXMotor3_clicked()
{
    SetLedStatus(10, 4);
}


/**************************************************************************/
/************************界面显示函数****************************************/
/**************************************************************************/
//车辆基本信息函数
void MainWindow::Robot_Base_Data_Show()
{
  QPalette color;
  QString word_str;
  QFont font;

  QList<QNetworkInterface> ifList = QNetworkInterface::allInterfaces();
  for(int i=0;i<ifList.count();i++)
  {
      QNetworkInterface inf = ifList.at(i);
      if(!inf.isValid())
      {
          continue;
      }

      QList<QNetworkAddressEntry> entryList = inf.addressEntries();
      for(int j=0;j<entryList.count();j++)
      {
          QNetworkAddressEntry entry = entryList.at(j);

          QString s = entry.ip().toString();
          if(s.contains("192.",Qt::CaseInsensitive) != 0 || s.contains("10.",Qt::CaseInsensitive) != 0 || s.contains("14.",Qt::CaseInsensitive) != 0 || s.contains("12.",Qt::CaseInsensitive) != 0)
          {
            if(s.contains(".10.",Qt::CaseInsensitive) != 0 || s.contains(".20.",Qt::CaseInsensitive) != 0 \
               || s.contains(".30.",Qt::CaseInsensitive) != 0 || s.contains(".40.",Qt::CaseInsensitive) != 0 \
               || s.contains(".60.",Qt::CaseInsensitive) != 0)
            {
            }
            else
            {
//              qDebug()<<"IP="<<s;
              font.setPointSize(WORD_SIZE);
              ui.IP->setFont(font);
              ui.IP->setAlignment(Qt::AlignLeft);
              ui.IP->setText(QString(s));
              color.setColor(QPalette::WindowText,Qt::green);
              ui.IP->setPalette(color);
            }
          }
      }
  }

  if(from_arm_check_connection_first == 0)
  {
    from_arm_check_connection_first++;
    from_arm_check_connection_last = from_arm_check_connection;
  }
  else if(from_arm_check_connection_first > 0 && from_arm_check_connection_first < 5)
  {
    from_arm_check_connection_first++;
  }

  if(from_arm_check_connection_first == 5)
  {
    if(from_arm_check_connection_last == from_arm_check_connection)
    {
      from_arm_check_connection_error = 1;
    }
    else
    {
      from_arm_check_connection_error = 0;
      from_arm_check_connection_first = 0;
    }
  }

  //电机和主控板显示
  if(sys_config_receive_.motor == 1)
  {
    if(sys_config_receive_.head.bit.board == 1)
    {
      font.setPointSize(WORD_SIZE_MIN);
      ui.MotorUsb->setFont(font);
      word_str = QString::fromLocal8Bit("HLS+U");
      ui.MotorUsb->setText(QString(word_str));                //显示页数
      ui.MotorUsb->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.MotorUsb->setPalette(color);
    }
    else if(sys_config_receive_.head.bit.board == 2)
    {
      font.setPointSize(WORD_SIZE_MIN);
      ui.MotorUsb->setFont(font);
      word_str = QString::fromLocal8Bit("HLS+N");
      ui.MotorUsb->setText(QString(word_str));                //显示页数
      ui.MotorUsb->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.MotorUsb->setPalette(color);
    }
  }
  else
  {
    if(sys_config_receive_.head.bit.board == 1)
    {
      font.setPointSize(WORD_SIZE_MIN);
      ui.MotorUsb->setFont(font);
      word_str = QString::fromLocal8Bit("LS+U");
      ui.MotorUsb->setText(QString(word_str));                //显示页数
      ui.MotorUsb->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.MotorUsb->setPalette(color);
    }
    else if(sys_config_receive_.head.bit.board == 2)
    {
      font.setPointSize(WORD_SIZE_MIN);
      ui.MotorUsb->setFont(font);
      word_str = QString::fromLocal8Bit("LS+N");
      ui.MotorUsb->setText(QString(word_str));                //显示页数
      ui.MotorUsb->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.MotorUsb->setPalette(color);
    }
  }

  //嵌入式连接状态
  font.setPointSize(WORD_SIZE);
  ui.ArmCommunitionCheck->setFont(font);
  word_str = QString::number(from_arm_check_connection, 10);
  ui.ArmCommunitionCheck->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.ArmCommunitionCheck->setPalette(color);

  //网络连接状态
  font.setPointSize(WORD_SIZE);
  ui.CommunitionCheck->setFont(font);
  word_str = QString::number(from_pc_check_net_connection_show, 10);

  QString bias = "/";
  word_str = word_str + bias + QString::number(from_pc_check_net_connection_show2, 10);
  ui.CommunitionCheck->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.CommunitionCheck->setPalette(color);

//    //网络连接状态2
//    QString bias = "/";
//    font.setPointSize(WORD_SIZE);
//    ui.CommunitionCheck_2->setFont(font);
//    word_str = bias + QString::number(from_pc_check_net_connection_show2, 10);
//    ui.CommunitionCheck_2->setText(QString(word_str));
//    color.setColor(QPalette::WindowText,Qt::green);
//    ui.CommunitionCheck_2->setPalette(color);

  //agv连接状态
  font.setPointSize(WORD_SIZE);
  ui.CommunitionCheck_agv->setFont(font);
  word_str = QString::number(from_pc_check_communication, 10);
  ui.CommunitionCheck_agv->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.CommunitionCheck_agv->setPalette(color);

  //机器人编号
  font.setPointSize(WORD_SIZE);
  ui.Number_robot->setFont(font);
//  word_str = QString::number(agv_rec_id_.agv_id, 10);
  word_str = QString::fromLocal8Bit("1");
  ui.Number_robot->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.Number_robot->setPalette(color);

  //
  font.setPointSize(WORD_SIZE);
  ui.auto_m->setFont(font);
  if(rtu317f_clean.in.ch.bit2_autoChange == 0)
  {
    word_str = QString::fromLocal8Bit("自动");
  }
  else
  {
    word_str = QString::fromLocal8Bit("手动");
  }

  ui.auto_m->setText(QString(word_str));                //显示页数
  ui.auto_m->setAlignment(Qt::AlignLeft);
  color.setColor(QPalette::WindowText,Qt::green);
  ui.auto_m->setPalette(color);

//  font.setPointSize(WORD_SIZE);
//  ui.Production_line->setFont(font);
////    word_str = QString::fromLocal8Bit(agv_rec_id_.agv_lines);                              //char型转qstring型
//  ui.Production_line->setText(QString(agv_rec_id_.agv_lines));//设置字体大小
//  color.setColor(QPalette::WindowText,Qt::green);
//  ui.Production_line->setPalette(color);

//  //定位报警显示
//  if(CarTypeStatus == 1)
//  {
//    if(usb_robot_status_run_.agv_error.status.local_status != 1)
//    {
//      ui.Position->setVisible(true);
////      ui.RobotBack->setPixmap(QPixmap(":/image/4dai/error1000.png"));

//      QImage img(":/image/4dai/error1000.png");
//      QImage scalimg = img.scaled(ui.RobotBack->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
//      ui.RobotBack->setPixmap(QPixmap::fromImage(scalimg));
//    }
//    else
//    {
//      ui.Position->setVisible(false);

//      QImage img(":/image/4dai/1000.png");
//      QImage scalimg = img.scaled(ui.RobotBack->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
//      ui.RobotBack->setPixmap(QPixmap::fromImage(scalimg));
//    }
//  }
//  else if(CarTypeStatus == 2)
//  {
//    if(usb_robot_status_run_.agv_error.status.local_status != 1)
//    {
//      ui.Position->setVisible(true);
//    }
//    else
//    {
//      ui.Position->setVisible(false);
//    }
//    QImage img(":/image/4dai/magnet.png");
//    QImage scalimg = img.scaled(ui.RobotBack->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
//    ui.RobotBack->setPixmap(QPixmap::fromImage(scalimg));
//  }
//  else if(CarTypeStatus == 3)
//  {
//    if(usb_robot_status_run_.agv_error.status.local_status != 1)
//    {
//      ui.Position->setVisible(true);
//    }
//    else
//    {
//      ui.Position->setVisible(false);
//    }
//    QImage img(":/image/seni.png");
//    QImage scalimg = img.scaled(ui.RobotBack->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
//    ui.RobotBack->setPixmap(QPixmap::fromImage(scalimg));
//  }
//  else if(CarTypeStatus == 4)
//  {
//    if(usb_robot_status_run_.agv_error.status.local_status != 1)
//    {
//      ui.Position->setVisible(true);
//    }
//    else
//    {
//      ui.Position->setVisible(false);
//    }

//    QImage img(":/image/chache/chache2.png");
//    QImage scalimg = img.scaled(ui.RobotBack->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
//    ui.RobotBack->setPixmap(QPixmap::fromImage(scalimg));
//  }
//  else if(CarTypeStatus == 5)
//  {
//    if(usb_robot_status_run_.agv_error.status.local_status != 1)
//    {
//      ui.Position->setVisible(true);
//    }
//    else
//    {
//      ui.Position->setVisible(false);
//    }

//    QImage img(":/image/smallred.png");
//    QImage scalimg = img.scaled(ui.RobotBack->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
//    ui.RobotBack->setPixmap(QPixmap::fromImage(scalimg));
//  }

  //抱手电机通讯异常
  if(CarTypeStatus == 1)
  {
    if((Motor_re[4].errorCode != 0 && Motor_re[4].state.b.error == 1) || Motor_re[4].state.b.online == 0)
    {
//        ui.Motor5Alarm->setVisible(true);
    }
    else
    {
//        ui.Motor5Alarm->setVisible(false);
    }
  }

  //障碍物报警
  if(CarTypeStatus == 1 || CarTypeStatus == 2)
  {
    if(usb_robot_status_run_.agv_error.status.nav_obstacle != 0 || usb_robot_status_run_.agv_error.status.attitude_obstacle != 0)
    {
//        ui.ObstacleAlarm->setVisible(true);
    }
    else
    {
//        ui.ObstacleAlarm->setVisible(false);
    }

    //防撞条警报
    if(rtu317.in.ch.bit12_impact== 1)
    {
//        ui.impact->setVisible(true);
    }
    else
    {
//        ui.impact->setVisible(false);
    }
  }



  battery_status_.percentage = qnode.battery_info_re_.percentage;
  battery_i = battery_status_.percentage;

  if(CarTypeStatus == 1)   //抱手车判断
  {
    if(battery_i >= 0 && battery_i <= 20)
    {
      ui.BatteryLow->setVisible(true);
    }
    else
    {
      ui.BatteryLow->setVisible(false);
    }
  }

  if(battery_i > 15 && battery_i <= 100)
  {
    font.setPointSize(WARNING_WORD_SIZE);
    ui.Battery->setFont(font);
    word_str = QString::number(battery_i, 10);
    ui.Battery->setText(QString(word_str));
    ui.Battery->setAlignment(Qt::AlignRight);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.Battery->setPalette(color);
  }
  else
  {
    font.setPointSize(WARNING_WORD_SIZE);
    ui.Battery->setFont(font);
    word_str = QString::number(battery_i, 10);
    ui.Battery->setText(QString(word_str));
    ui.Battery->setAlignment(Qt::AlignRight);
    color.setColor(QPalette::WindowText,Qt::yellow);
    ui.Battery->setPalette(color);
  }


  if(battery_i == 100)
  {
    ui.BatteryGreen->setVisible(true);
    ui.BatteryGreen_2->setVisible(true);
    ui.BatteryGreen_3->setVisible(true);
    ui.BatteryGreen_4->setVisible(true);
    ui.BatteryGreen_5->setVisible(true);
    ui.BatteryGreen_6->setVisible(true);
    ui.BatteryGreen_7->setVisible(true);
  }
  else if(battery_i >= 84 && battery_i <= 99)
  {
    ui.BatteryGreen->setVisible(true);
    ui.BatteryGreen_2->setVisible(true);
    ui.BatteryGreen_3->setVisible(true);
    ui.BatteryGreen_4->setVisible(true);
    ui.BatteryGreen_5->setVisible(true);
    ui.BatteryGreen_6->setVisible(true);
    ui.BatteryGreen_7->setVisible(false);
  }
  else if(battery_i >= 69 && battery_i <= 83)
  {
    ui.BatteryGreen->setVisible(true);
    ui.BatteryGreen_2->setVisible(true);
    ui.BatteryGreen_3->setVisible(true);
    ui.BatteryGreen_4->setVisible(true);
    ui.BatteryGreen_5->setVisible(true);
    ui.BatteryGreen_6->setVisible(false);
    ui.BatteryGreen_7->setVisible(false);
  }
  else if(battery_i >= 54 && battery_i <= 68)
  {
    ui.BatteryGreen->setVisible(true);
    ui.BatteryGreen_2->setVisible(true);
    ui.BatteryGreen_3->setVisible(true);
    ui.BatteryGreen_4->setVisible(true);
    ui.BatteryGreen_5->setVisible(false);
    ui.BatteryGreen_6->setVisible(false);
    ui.BatteryGreen_7->setVisible(false);
  }
  else if(battery_i >= 38 && battery_i <= 53)
  {
    ui.BatteryGreen->setVisible(true);
    ui.BatteryGreen_2->setVisible(true);
    ui.BatteryGreen_3->setVisible(true);
    ui.BatteryGreen_4->setVisible(false);
    ui.BatteryGreen_5->setVisible(false);
    ui.BatteryGreen_6->setVisible(false);
    ui.BatteryGreen_7->setVisible(false);
  }
  else if(battery_i >= 22 && battery_i <= 37)
  {
    ui.BatteryGreen->setVisible(true);
    ui.BatteryGreen_2->setVisible(true);
    ui.BatteryGreen_3->setVisible(false);
    ui.BatteryGreen_4->setVisible(false);
    ui.BatteryGreen_5->setVisible(false);
    ui.BatteryGreen_6->setVisible(false);
    ui.BatteryGreen_7->setVisible(false);
  }
  else if(battery_i >= 10 && battery_i <= 21)
  {
    ui.BatteryGreen->setVisible(true);
    ui.BatteryGreen_2->setVisible(false);
    ui.BatteryGreen_3->setVisible(false);
    ui.BatteryGreen_4->setVisible(false);
    ui.BatteryGreen_5->setVisible(false);
    ui.BatteryGreen_6->setVisible(false);
    ui.BatteryGreen_7->setVisible(false);
  }
  else
  {
    ui.BatteryGreen->setVisible(false);
    ui.BatteryGreen_2->setVisible(false);
    ui.BatteryGreen_3->setVisible(false);
    ui.BatteryGreen_4->setVisible(false);
    ui.BatteryGreen_5->setVisible(false);
    ui.BatteryGreen_6->setVisible(false);
    ui.BatteryGreen_7->setVisible(false);
  }

  font.setPointSize(WORD_SIZE);
  ui.Connect_check->setFont(font);
  color.setColor(QPalette::WindowText,Qt::yellow);
  ui.Connect_check->setPalette(color);
  if(AgvInit == 0)
  {
      word_str = QString::fromLocal8Bit("系统等待上电就绪状态");
      ui.Connect_check->setText(word_str);
  }
  else if(AgvInit == 1)
  {
    color.setColor(QPalette::WindowText,Qt::green);
    ui.Connect_check->setPalette(color);
    word_str = QString::fromLocal8Bit("系统初始化完成");
    ui.Connect_check->setText(word_str);
  }
  else if(AgvInit == 2)
  {
      word_str = QString::fromLocal8Bit("系统底盘等待使能完成状态");
      ui.Connect_check->setText(word_str);
  }
  else if(AgvInit == 3)
  {
      word_str = QString::fromLocal8Bit("系统出现错误");
      ui.Connect_check->setText(word_str);
  }
  else if(AgvInit == 4)
  {
      word_str = QString::fromLocal8Bit("系统抱手等待使能");
      ui.Connect_check->setText(word_str);
  }
  else if(AgvInit == 5)
  {
      word_str = QString::fromLocal8Bit("/抱手等待回零状态");
      ui.Connect_check->setText(word_str);
  }

  //遥控状态
    if(control != 2 && Remote_Control_status == 0)
  {
      ui.RemoteControl->setPixmap(QPixmap(":/image/chache/buleping.png"));
      ui.RemoteControl->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.RemoteControl_Text->setFont(font);
      word_str = QString::fromLocal8Bit("遥控");
      ui.RemoteControl_Text->setText(QString(word_str));                //显示页数
      ui.RemoteControl_Text->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RemoteControl_Text->setPalette(color);

  }
  else
  {
      ui.RemoteControl->setPixmap(QPixmap(":/image/chache/redping.png"));
      ui.RemoteControl->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.RemoteControl_Text->setFont(font);
      word_str = QString::fromLocal8Bit("遥控");
      ui.RemoteControl_Text->setText(QString(word_str));                //显示页数
      ui.RemoteControl_Text->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RemoteControl_Text->setPalette(color);
  }

    //安全雷达障碍物状态
    if(SafeRadarStatus_L < 7 && SafeRadarStatus_L >=0)
    {
        ui.RadarAlarmFlag->setPixmap(QPixmap(":/image/chache/redping.png"));
        ui.RadarAlarmFlag->setScaledContents(true);

        font.setPointSize(WARNING_WORD_SIZE_24);
        ui.RadarAlarmFlag_Text->setFont(font);
        word_str = QString::fromLocal8Bit("雷达");
        ui.RadarAlarmFlag_Text->setText(QString(word_str));                //显示页数
        ui.RadarAlarmFlag_Text->setAlignment(Qt::AlignCenter);
        color.setColor(QPalette::WindowText,Qt::white);
        ui.RadarAlarmFlag_Text->setPalette(color);
    }
    else
    {
        ui.RadarAlarmFlag->setPixmap(QPixmap(":/image/chache/buleping.png"));
        ui.RadarAlarmFlag->setScaledContents(true);

        font.setPointSize(WARNING_WORD_SIZE_24);
        ui.RadarAlarmFlag_Text->setFont(font);
        word_str = QString::fromLocal8Bit("雷达");
        ui.RadarAlarmFlag_Text->setText(QString(word_str));                //显示页数
        ui.RadarAlarmFlag_Text->setAlignment(Qt::AlignCenter);
        color.setColor(QPalette::WindowText,Qt::white);
        ui.RadarAlarmFlag_Text->setPalette(color);
    }


//  agv_loc_status = 2;
  //0空闲1忙碌2建图
  if(agv_loc_status == 0)
  {
    ui.TaskMisInfo->setPixmap(QPixmap(":/image/chache/buleping.png"));
    ui.TaskMisInfo->setScaledContents(true);

    font.setPointSize(WARNING_WORD_SIZE_24);
    ui.TaskMisInfo_label->setFont(font);
    word_str = QString::fromLocal8Bit("忙碌");
    ui.TaskMisInfo_label->setText(QString(word_str));                //显示页数
    ui.TaskMisInfo_label->setAlignment(Qt::AlignCenter);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.TaskMisInfo_label->setPalette(color);
  }
  else if(agv_loc_status == 1)
  {
    ui.TaskMisInfo->setPixmap(QPixmap(":/image/chache/greenping.png"));
    ui.TaskMisInfo->setScaledContents(true);

    font.setPointSize(WARNING_WORD_SIZE_24);
    ui.TaskMisInfo_label->setFont(font);
    word_str = QString::fromLocal8Bit("忙碌");
    ui.TaskMisInfo_label->setText(QString(word_str));                //显示页数
    ui.TaskMisInfo_label->setAlignment(Qt::AlignCenter);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.TaskMisInfo_label->setPalette(color);
  }
  else if(agv_loc_status ==2)
  {
    ui.TaskMisInfo->setPixmap(QPixmap(":/image/chache/greenping.png"));
    ui.TaskMisInfo->setScaledContents(true);

    font.setPointSize(WARNING_WORD_SIZE_24);
    ui.TaskMisInfo_label->setFont(font);
    word_str = QString::fromLocal8Bit("忙碌");
    ui.TaskMisInfo_label->setText(QString(word_str));                //显示页数
    ui.TaskMisInfo_label->setAlignment(Qt::AlignCenter);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.TaskMisInfo_label->setPalette(color);
  }

//  if(usb_robot_status_run_.status_brake == 1)
//  {
//      ui.BrakeL->setPixmap(QPixmap(":/image/chache/yellowping.png"));
//      ui.BrakeL->setScaledContents(true);

//      font.setPointSize(WARNING_WORD_SIZE);
//      ui.BrakeLText->setFont(font);
//      word_str = QString::fromLocal8Bit("刹车");
//      ui.BrakeLText->setText(QString(word_str));                //显示页数
//      ui.BrakeLText->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.BrakeLText->setPalette(color);

//  }
//  else
//  {

//      ui.BrakeL->setPixmap(QPixmap(":/image/chache/buleping.png"));
//      ui.BrakeL->setScaledContents(true);

//      font.setPointSize(WARNING_WORD_SIZE);
//      ui.BrakeLText->setFont(font);
//      word_str = QString::fromLocal8Bit("刹车");
//      ui.BrakeLText->setText(QString(word_str));                //显示页数
//      ui.BrakeLText->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.BrakeLText->setPalette(color);
//  }

  //手动暂停反馈
  if(usb_robot_status_run_.agv_error.status.robot_pause == 1)
  {
      ui.Pause->setPixmap(QPixmap(":/image/chache/yellowping.png"));
      ui.Pause->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.PauseText->setFont(font);
      word_str = QString::fromLocal8Bit("刹车");
      ui.PauseText->setText(QString(word_str));                //显示页数
      ui.PauseText->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.PauseText->setPalette(color);

  }
  else
  {
      ui.Pause->setPixmap(QPixmap(":/image/chache/buleping.png"));
      ui.Pause->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.PauseText->setFont(font);
      word_str = QString::fromLocal8Bit("刹车");
      ui.PauseText->setText(QString(word_str));                //显示页数
      ui.PauseText->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.PauseText->setPalette(color);
  }

//  //服务器报警
//  if(from_pc_check_net_connection == 0 && AgvInit == 1)
//  {
//      ui.ServerMain->setPixmap(QPixmap(":/image/chache/redping.png"));
//      ui.ServerMain->setScaledContents(true);

//      font.setPointSize(WARNING_WORD_SIZE_24);
//      ui.ServerMain_Text->setFont(font);
//      word_str = QString::fromLocal8Bit("服务器");
//      ui.ServerMain_Text->setText(QString(word_str));                //显示页数
//      ui.ServerMain_Text->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.ServerMain_Text->setPalette(color);

//  }
//  else
//  {
//      ui.ServerMain->setPixmap(QPixmap(":/image/chache/buleping.png"));
//      ui.ServerMain->setScaledContents(true);

//      font.setPointSize(WARNING_WORD_SIZE_24);
//      ui.ServerMain_Text->setFont(font);
//      word_str = QString::fromLocal8Bit("服务器");
//      ui.ServerMain_Text->setText(QString(word_str));                //显示页数
//      ui.ServerMain_Text->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.ServerMain_Text->setPalette(color);
//  }

  //定位报警
   if(usb_robot_status_run_.agv_error.status.local_status != 1)
  {
      ui.PositonMain->setPixmap(QPixmap(":/image/chache/redping.png"));
      ui.PositonMain->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.PositonMain_Text->setFont(font);
      word_str = QString::fromLocal8Bit("定位");
      ui.PositonMain_Text->setText(QString(word_str));                //显示页数
      ui.PositonMain_Text->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.PositonMain_Text->setPalette(color);

  }
  else
  {
      ui.PositonMain->setPixmap(QPixmap(":/image/chache/buleping.png"));
      ui.PositonMain->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.PositonMain_Text->setFont(font);
      word_str = QString::fromLocal8Bit("定位");
      ui.PositonMain_Text->setText(QString(word_str));                //显示页数
      ui.PositonMain_Text->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.PositonMain_Text->setPalette(color);
  }

   //里程计报警
    if(usb_robot_status_run_.agv_error.status.odom_status == 1)
   {
       ui.OdomMain->setPixmap(QPixmap(":/image/chache/redping.png"));
       ui.OdomMain->setScaledContents(true);

       font.setPointSize(WARNING_WORD_SIZE_24);
       ui.OdomMain_Text->setFont(font);
       word_str = QString::fromLocal8Bit("里程计");
       ui.OdomMain_Text->setText(QString(word_str));                //显示页数
       ui.OdomMain_Text->setAlignment(Qt::AlignCenter);
       color.setColor(QPalette::WindowText,Qt::white);
       ui.OdomMain_Text->setPalette(color);

   }
   else
   {
       ui.OdomMain->setPixmap(QPixmap(":/image/chache/buleping.png"));
       ui.OdomMain->setScaledContents(true);

       font.setPointSize(WARNING_WORD_SIZE_24);
       ui.OdomMain_Text->setFont(font);
       word_str = QString::fromLocal8Bit("里程计");
       ui.OdomMain_Text->setText(QString(word_str));                //显示页数
       ui.OdomMain_Text->setAlignment(Qt::AlignCenter);
       color.setColor(QPalette::WindowText,Qt::white);
       ui.OdomMain_Text->setPalette(color);
   }

    int motorErrorMode = 0;
    //电机报警
    for(int i=0; i<MOTOR_NUM_T; i++)
//    for(int i=0; i<MOTOR_NUM; i++)
    {
      if((Motor_re[i].errorCode != 0 && Motor_re[i].state.b.error == 1) || Motor_re[i].state.b.online == 0)
      {
        motorErrorMode = 2;
        break;
      }
      else if((Motor_re[i].errorCode != 0 && Motor_re[i].state.b.error == 0))
      {
        motorErrorMode = 1;
        break;
      }
      else
        motorErrorMode = 0;
    }

     if(motorErrorMode == 2)
    {
        ui.MotorMain->setPixmap(QPixmap(":/image/chache/redping.png"));
        ui.MotorMain->setScaledContents(true);

        font.setPointSize(WARNING_WORD_SIZE_24);
        ui.MotorMain_Text->setFont(font);
        word_str = QString::fromLocal8Bit("电机");
        ui.MotorMain_Text->setText(QString(word_str));                //显示页数
        ui.MotorMain_Text->setAlignment(Qt::AlignCenter);
        color.setColor(QPalette::WindowText,Qt::white);
        ui.MotorMain_Text->setPalette(color);

    }
    else if(motorErrorMode == 1)
     {
         ui.MotorMain->setPixmap(QPixmap(":/image/chache/yellowping.png"));
         ui.MotorMain->setScaledContents(true);

         font.setPointSize(WARNING_WORD_SIZE_24);
         ui.MotorMain_Text->setFont(font);
         word_str = QString::fromLocal8Bit("电机");
         ui.MotorMain_Text->setText(QString(word_str));                //显示页数
         ui.MotorMain_Text->setAlignment(Qt::AlignCenter);
         color.setColor(QPalette::WindowText,Qt::white);
         ui.MotorMain_Text->setPalette(color);

     }
    else
    {
        ui.MotorMain->setPixmap(QPixmap(":/image/chache/buleping.png"));
        ui.MotorMain->setScaledContents(true);

        font.setPointSize(WARNING_WORD_SIZE_24);
        ui.MotorMain_Text->setFont(font);
        word_str = QString::fromLocal8Bit("电机");
        ui.MotorMain_Text->setText(QString(word_str));                //显示页数
        ui.MotorMain_Text->setAlignment(Qt::AlignCenter);
        color.setColor(QPalette::WindowText,Qt::white);
        ui.MotorMain_Text->setPalette(color);
    }

  if(usb_robot_status_run_.agv_error.status.traffic == 2)
  {
      ui.ControlL->setPixmap(QPixmap(":/image/chache/yellowping.png"));
      ui.ControlL->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.ControlText->setFont(font);
      word_str = QString::fromLocal8Bit("管制");
      ui.ControlText->setText(QString(word_str));                //显示页数
      ui.ControlText->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.ControlText->setPalette(color);
  }
  else
  {
      ui.ControlL->setPixmap(QPixmap(":/image/chache/buleping.png"));
      ui.ControlL->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.ControlText->setFont(font);
      word_str = QString::fromLocal8Bit("管制");
      ui.ControlText->setText(QString(word_str));                //显示页数
      ui.ControlText->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.ControlText->setPalette(color);
  }

  if(usb_robot_status_run_.agv_error.status.attitude_obstacle != 0 || usb_robot_status_run_.agv_error.status.nav_obstacle != 0)
  {
      ui.ObstacleL->setPixmap(QPixmap(":/image/chache/redping.png"));
      ui.ObstacleL->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.ObstacleText->setFont(font);
      word_str = QString::fromLocal8Bit("障碍");
      ui.ObstacleText->setText(QString(word_str));                //显示页数
      ui.ObstacleText->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.ObstacleText->setPalette(color);
  }
  else
  {
      ui.ObstacleL->setPixmap(QPixmap(":/image/chache/buleping.png"));
      ui.ObstacleL->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.ObstacleText->setFont(font);
      word_str = QString::fromLocal8Bit("障碍");
      ui.ObstacleText->setText(QString(word_str));                //显示页数
      ui.ObstacleText->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.ObstacleText->setPalette(color);
  }

  if(rtu317.in.ch.bit0_emergency1 == 1 || rtu317.in.ch.bit1_emergency2 == 1)
  {
      ui.StopL->setPixmap(QPixmap(":/image/chache/redping.png"));
      ui.StopL->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.StopText->setFont(font);
      word_str = QString::fromLocal8Bit("急停");
      ui.StopText->setText(QString(word_str));                //显示页数
      ui.StopText->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.StopText->setPalette(color);
  }
  else
  {
      ui.StopL->setPixmap(QPixmap(":/image/chache/buleping.png"));
      ui.StopL->setScaledContents(true);

      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.StopText->setFont(font);
      word_str = QString::fromLocal8Bit("急停");
      ui.StopText->setText(QString(word_str));                //显示页数
      ui.StopText->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.StopText->setPalette(color);
  }

  //遥控
  if(control != 2 && Remote_Control_status == 0)
  {
      font.setPointSize(WORD_SIZE);
      ui.RemoteStatus->setFont(font);
      word_str = QString::fromLocal8Bit("正常");
      ui.RemoteStatus->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.RemoteStatus->setPalette(color);
  }
  else if(control !=2 && Remote_Control_status == 1)
  {
      font.setPointSize(WORD_SIZE);
      ui.RemoteStatus->setFont(font);
      word_str = QString::fromLocal8Bit("网页遥控");
      ui.RemoteStatus->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.RemoteStatus->setPalette(color);
  }
  else if(control == 2)
  {
      font.setPointSize(WORD_SIZE);
      ui.RemoteStatus->setFont(font);
      word_str = QString::fromLocal8Bit("手持遥控");
      ui.RemoteStatus->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.RemoteStatus->setPalette(color);
  }

  //程序版本
  font.setPointSize(WORD_SIZE);
  ui.Version->setFont(font);
  word_str = version_status;
  ui.Version->setText(QString(version_status));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.Version->setPalette(color);

  font.setPointSize(WORD_SIZE);
  ui.Version_screen->setFont(font);
  QString word_str_v = QString::fromLocal8Bit("V ");
  word_str = QString("%1").arg(1.2);
  word_str = word_str_v + word_str;
  ui.Version_screen->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.Version_screen->setPalette(color);

  //显示任务基础信息
  //missionId
  if(agv_loc_status == 0 || agv_loc_status == 2)
  {
    font.setPointSize(WORD_SIZE);
    ui.Ser_mis_id->setFont(font);
    word_str = QString::fromLocal8Bit("");
    ui.Ser_mis_id->setText(QString(word_str));
    color.setColor(QPalette::WindowText,Qt::green);
    ui.Ser_mis_id->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    ui.Ser_mis_id->setFont(font);
    word_str = QString::number(mission_info_.missionId, 10);
    ui.Ser_mis_id->setText(QString(word_str));
    color.setColor(QPalette::WindowText,Qt::green);
    ui.Ser_mis_id->setPalette(color);
  }

  //buzhou
  font.setPointSize(WORD_SIZE);
  ui.Mis_sub->setFont(font);
  word_str = QString::number(mission_info_.subMission, 10);
  ui.Mis_sub->setText(word_str);
  color.setColor(QPalette::WindowText,Qt::green);
  ui.Mis_sub->setPalette(color);

  //mingcheng
//  if(agv_loc_status == 0 || agv_loc_status == 2)
//  {
//    font.setPointSize(WORD_SIZE);
//    ui.TaskType->setFont(font);
//    word_str = QString::fromLocal8Bit("");
//    ui.TaskType->setText(word_str);
//    color.setColor(QPalette::WindowText,Qt::green);
//    ui.TaskType->setPalette(color);
//  }
//  else
//  {
//    font.setPointSize(WORD_SIZE);
//    ui.TaskType->setFont(font);
//    word_str = QString::fromLocal8Bit(mission_info_.missionName.c_str());
//    ui.TaskType->setText(word_str);
//    color.setColor(QPalette::WindowText,Qt::green);
//    ui.TaskType->setPalette(color);
//  }

  //zhuangtai
  font.setPointSize(WORD_SIZE);
  ui.SubMisType->setFont(font);
  word_str = QString::fromLocal8Bit(mission_info_.missionInfo.c_str());
  ui.SubMisType->setText(word_str);
  color.setColor(QPalette::WindowText,Qt::green);
  ui.SubMisType->setPalette(color);

//  qDebug()<< battery_status_.percentage << sys_config_receive_.test ;

  //测试模式电量报警
//  else if((battery_status_.percentage < 25) && (sys_config_receive_.test == 10))
//  if((battery_status_.percentage < 25) && (sys_config_receive_.test == 10))
//  {
//    font.setPointSize(WARNING_TOP_WORD_SIZE);
//    ui.WarningLa->setFont(font);
//    QString word_str = QString::fromLocal8Bit("电量低底盘强制断电");
//    ui.WarningLa->setText(QString(word_str));                //显示页数
//    color.setColor(QPalette::WindowText,Qt::white);
//    ui.WarningLa->setPalette(color);

//    ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
//    ui.WarningTop->setScaledContents(true);
//  }

//  qDebug("radar = %d", usb_robot_status_run_.agv_error.status.position_radar_error);
//  int ceshi = 1;

  ////////////WARNING////////////////////
//  //AGV通讯异常
//  if(PcAgvScreenComStatusAlarm == 1)
//  {
//    font.setPointSize(WARNING_WORD_SIZE_24);
//    ui.WarningLa->setFont(font);
//    word_str = QString::fromLocal8Bit("屏幕与AGV通讯异常");
//    ui.WarningLa->setText(QString(word_str));                //显示页数
//    ui.WarningLa->setAlignment(Qt::AlignRight);
//    color.setColor(QPalette::WindowText,Qt::white);
//    ui.WarningLa->setPalette(color);

//    ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
//    ui.WarningTop->setScaledContents(true);
//  }
  //导航雷达
  if(usb_robot_status_run_.agv_error.status.position_radar_error == 1)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("导航雷达异常");
      ui.WarningLa->setText(QString(word_str));
      ui.WarningLa->setAlignment(Qt::AlignRight);//显示页数
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //识别雷达
  else if(usb_robot_status_run_.agv_error.status.scan_radar_error == 1)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("识别雷达异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //嵌入式连接报警
  else if(from_arm_check_connection_error == 1)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("主控通讯异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //USB
  else if(usb_robot_status_run_.agv_error.status.serial_status == 1)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("USB连接异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //odom
  else if(usb_robot_status_run_.agv_error.status.odom_status == 1)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("里程计异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //避障雷达
  else if(usb_robot_status_run_.agv_error.status.obstacle_radar_error == 1)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("避障雷达异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //IO模块通讯状态
  else if(IO_stauts.state.b.online == 0)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("IO模块异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  else if(rtu317.in.ch.bit12_impact == 1)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("防撞条异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //电池通讯状态
  else if(battery_status_.state.b.online == 0)
  {
      font.setPointSize(WARNING_TOP_WORD_SIZE);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("电池通讯异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
//  //网络连接
//  else if(from_pc_check_net_connection == 0)
//  {
//      font.setPointSize(WARNING_WORD_SIZE_24);
//      ui.WarningLa->setFont(font);
//      word_str = QString::fromLocal8Bit("服务器通讯异常");
//      ui.WarningLa->setText(QString(word_str));                //显示页数
//      ui.WarningLa->setAlignment(Qt::AlignRight);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.WarningLa->setPalette(color);

//      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
//      ui.WarningTop->setScaledContents(true);
//  }

  else if(usb_robot_status_run_.agv_error.status.local_status == 0)
  {
    font.setPointSize(WARNING_WORD_SIZE_24);
    ui.WarningLa->setFont(font);
    word_str = QString::fromLocal8Bit("机器人未定位");
    ui.WarningLa->setText(QString(word_str));                //显示页数
    ui.WarningLa->setAlignment(Qt::AlignRight);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.WarningLa->setPalette(color);

    ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
    ui.WarningTop->setScaledContents(true);
  }
  else if(usb_robot_status_run_.agv_error.status.local_status == 2)
  {
    font.setPointSize(WARNING_WORD_SIZE_24);
    ui.WarningLa->setFont(font);
    word_str = QString::fromLocal8Bit("初始定位失败");
    ui.WarningLa->setText(QString(word_str));                //显示页数
    ui.WarningLa->setAlignment(Qt::AlignRight);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.WarningLa->setPalette(color);

    ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
    ui.WarningTop->setScaledContents(true);
  }
  else if(usb_robot_status_run_.agv_error.status.local_status == 3)
  {
    font.setPointSize(WARNING_WORD_SIZE_24);
    ui.WarningLa->setFont(font);
    word_str = QString::fromLocal8Bit("定位异常");
    ui.WarningLa->setText(QString(word_str));                //显示页数
    ui.WarningLa->setAlignment(Qt::AlignRight);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.WarningLa->setPalette(color);

    ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
    ui.WarningTop->setScaledContents(true);
  }

  //弗洛伊德规划失败
  else if(usb_robot_status_run_.agv_error.status.floyd_fail == 1)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("路径规划异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }

  else if(AlarmHandle_status != 0)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("缩回、伸出传感器异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }

  //避障雷达错误警报
  else if(usb_robot_status_run_.agv_error.status.obstacle_radar_error == 1)
  {
    font.setPointSize(WARNING_WORD_SIZE_24);
    ui.WarningLa->setFont(font);
    word_str = QString::fromLocal8Bit("避障雷达异常");
    ui.WarningLa->setText(QString(word_str));                //显示页数
    ui.WarningLa->setAlignment(Qt::AlignRight);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.WarningLa->setPalette(color);

    ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
    ui.WarningTop->setScaledContents(true);
  }

  //电机1通讯警报
  else if((Motor_re[0].errorCode != 0 && Motor_re[0].state.b.error == 1) || Motor_re[0].state.b.online == 0)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("电机1通讯异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);

  }

  else if((Motor_re[1].errorCode != 0 && Motor_re[1].state.b.error == 1) || Motor_re[1].state.b.online == 0)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("电机2通讯异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }

  //电机3通讯警报
  else if((Motor_re[2].errorCode != 0 && Motor_re[2].state.b.error == 1) || Motor_re[2].state.b.online == 0)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("电机3通讯异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //电机4通讯警报
  else if(((Motor_re[3].errorCode != 0 && Motor_re[3].state.b.error == 1) || Motor_re[3].state.b.online == 0) \
          && CarTypeStatus != 4 && CarTypeStatus != 5)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("电机4通讯异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //电机5通讯警报
  else if(((Motor_re[4].errorCode != 0 && Motor_re[4].state.b.error == 1) || Motor_re[4].state.b.online == 0) \
           && CarTypeStatus != 4 && CarTypeStatus != 5)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("电机5通讯异常");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //路径障碍检测
  else if(usb_robot_status_run_.agv_error.status.nav_obstacle != 0)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("机器人前方检测到障碍");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }

  //旋转障碍检测
  else if(usb_robot_status_run_.agv_error.status.attitude_obstacle != 0)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("机器人旋转方向检测到障碍");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //交通管制
  else if(usb_robot_status_run_.agv_error.status.traffic == 1)
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("交通管制");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
      ui.WarningTop->setScaledContents(true);
  }
  //
  else if((SafeRadarStatus_L < 7 && SafeRadarStatus_L >=0) && SafeRadar_L.areaSet.data != 255)
  {
    font.setPointSize(WARNING_WORD_SIZE_24);
    ui.WarningLa->setFont(font);
    word_str = QString::fromLocal8Bit("后安全雷达有障碍物");
    ui.WarningLa->setText(QString(word_str));                //显示页数
    ui.WarningLa->setAlignment(Qt::AlignRight);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.WarningLa->setPalette(color);

    ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
    ui.WarningTop->setScaledContents(true);
  }
  else if((SafeRadarStatus_R < 7 && SafeRadarStatus_R >=0) && SafeRadar_R.areaSet.data != 255)
  {
    font.setPointSize(WARNING_WORD_SIZE_24);
    ui.WarningLa->setFont(font);
    word_str = QString::fromLocal8Bit("前安全雷达有障碍物");
    ui.WarningLa->setText(QString(word_str));                //显示页数
    ui.WarningLa->setAlignment(Qt::AlignRight);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.WarningLa->setPalette(color);

    ui.WarningTop->setPixmap(QPixmap(":/image/red.png"));
    ui.WarningTop->setScaledContents(true);
  }
  else
  {
      font.setPointSize(WARNING_WORD_SIZE_24);
      ui.WarningLa->setFont(font);
      word_str = QString::fromLocal8Bit("");
      ui.WarningLa->setText(QString(word_str));                //显示页数
      ui.WarningLa->setAlignment(Qt::AlignRight);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.WarningLa->setPalette(color);

      ui.WarningTop->setPixmap(QPixmap(":/image/blue.png"));
      ui.WarningTop->setScaledContents(true);
  }
}

//警报显示
void MainWindow::Alarmchange()
{
  QPalette color;
  QString word_str;
  QFont font;

  if(CarTypeStatus == 1)
  {
    //急停拍下
    if(rtu317f_clean.in.ch.bit0_emergency1 == 1 || rtu317f_clean.in.ch.bit1_emergency2 == 1)
    {
  //        word_str = QString::fromLocal8Bit("急停按钮拍下!");

        font.setPointSize(WORD_SIZE);
        ui.StopBtnStatus->setFont(font);
        word_str = QString::fromLocal8Bit("急停按钮拍下");
        ui.StopBtnStatus->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.StopBtnStatus->setPalette(color);
        ui.StopBtnStatus->setAlignment(Qt::AlignCenter);
        ui.StopBtnStatusBtn->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.emergency == 0)
        {
           alarm_staus_.emergency = 23;
           errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
      font.setPointSize(WORD_SIZE);
      ui.StopBtnStatus->setFont(font);
      word_str = QString::fromLocal8Bit("无警报");
      ui.StopBtnStatus->setText(QString(word_str));                //显示页数
      color.setColor(QPalette::WindowText,Qt::green);
      ui.StopBtnStatus->setPalette(color);
      ui.StopBtnStatus->setAlignment(Qt::AlignCenter);

      ui.StopBtnStatusBtn->setIcon(QIcon(":/image/chache/Warningblue.png"));


        if(alarm_staus_.emergency == 23)
        {
          alarm_staus_.emergency = 0;
          word_str = QString::fromLocal8Bit("急停按钮松开");
          errorLocalLogInfoDecode(word_str);
        }
    }

    //agvalarm
//    if(PcAgvScreenComStatusAlarm == 1)
//    {
//        font.setPointSize(WORD_SIZE);
//        ui.AgvAlarm->setFont(font);
//        word_str = QString::fromLocal8Bit("AGV通讯报警");
//        ui.AgvAlarm->setText(QString(word_str));                //显示页数
//        color.setColor(QPalette::WindowText,Qt::red);
//        ui.AgvAlarm->setPalette(color);
//        ui.AgvAlarm->setAlignment(Qt::AlignCenter);
//        ui.AgvAlarmBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

//        if(alarm_staus_.agv_alarm == 0)
//        {
//           alarm_staus_.agv_alarm = 26;
//           errorLocalLogInfoDecode(word_str);
//        }
//    }
//    else
//    {
//        font.setPointSize(WORD_SIZE);
//        ui.AgvAlarm->setFont(font);
//        word_str = QString::fromLocal8Bit("无警报");
//        ui.AgvAlarm->setText(QString(word_str));                //显示页数
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.AgvAlarm->setPalette(color);
//        ui.AgvAlarm->setAlignment(Qt::AlignCenter);

//        ui.AgvAlarmBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));

//        if(alarm_staus_.agv_alarm == 26)
//        {
//           alarm_staus_.agv_alarm = 0;
//        }

//    }

    //防撞条警报
    if(rtu317f_clean.in.ch.bit4_impact == 1 || rtu317f_clean.in.ch.bit8_impact == 1 || rtu317f_clean.in.ch.bit9_impact == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.impactalarm->setFont(font);
        word_str = QString::fromLocal8Bit("防撞条警报");
        ui.impactalarm->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.impactalarm->setPalette(color);
        ui.impactalarm->setAlignment(Qt::AlignCenter);
        ui.impactbutton->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.impact_alarm_status == 0)
        {
           alarm_staus_.impact_alarm_status = 1;
           errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.impactalarm->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.impactalarm->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.impactalarm->setPalette(color);
        ui.impactalarm->setAlignment(Qt::AlignCenter);

        ui.impactbutton->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.impact_alarm_status == 1)
        {
           alarm_staus_.impact_alarm_status = 0;
        }

    }

  //  if(AgvInit == 1)
    {

      for(int i=0; i<MOTOR_NUM_T; i++)
//      for(int i=0; i<MOTOR_NUM; i++)
      {
        if((Motor_re[i].errorCode != 0 && Motor_re[i].state.b.error == 1) || Motor_re[i].state.b.online == 0)
        {
          if(Motor_re[i].state.b.error == 1)
          {
            switch(Motor_re[i].errorCode)
            {
              case 2200:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("欠压警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//"电机1欠压警报";
              }break;

              case 2500:
              case 2501:
              case 2502:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("过流警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//
              }break;

              case 2510:
              case 2900:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("过载警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//
              }break;

              case 2520:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("超速警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//

              }break;

              case 2530:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("母线电压高警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//
              }break;

              case 2630:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("温度过高警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//
              }break;

              default :
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("未知报警:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;
              }break;
            }
          }
          else
          {
            word_str = QString::fromLocal8Bit("电机");
            word_str.append(QString::number(Motor_re[i].serialNum));
            word_str.append(QString::fromLocal8Bit("掉线"));
  //          alarm_show_info_motro[i] = word_str;
          }

  //        qDebug("motor num = %d", i);
          QString initword;
          if(AgvInit == 1)
          {
            initword = QString::fromLocal8Bit("完成初始化,");
          }
          else
          {
            initword = QString::fromLocal8Bit("初始化中,");
          }
          QString front = QString::fromLocal8Bit("电机警报总共:");
          QString num = QString::number(Motor_re[0].count, 10);
          QString back = QString::fromLocal8Bit("次");

          QString word_str1 = initword + word_str + " " + front + num + back;

          if(i >= 0 && i < 5)
          {
            font.setPointSize(WORD_SIZE);
            MyMotor[i]->setFont(font);
            MyMotor[i]->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::red);
            MyMotor[i]->setPalette(color);
            MyMotor[i]->setAlignment(Qt::AlignCenter);
            MyMotorBnt[i]->setIcon(QIcon(":/image/chache/WarningRed.png"));

            if(*alarmFlag[i] == 0)
            {
              *alarmFlag[i] = i + 2;
              errorLocalLogInfoDecode(word_str1);
            }
          }
          else if(i == 5)
          {
            if(motorNumMode == 1)
            {
              font.setPointSize(WORD_SIZE);
              MyMotor[i]->setFont(font);
              MyMotor[i]->setText(QString(word_str));                //显示页数
              color.setColor(QPalette::WindowText,Qt::red);
              MyMotor[i]->setPalette(color);
              MyMotor[i]->setAlignment(Qt::AlignCenter);
              MyMotorBnt[i]->setIcon(QIcon(":/image/chache/WarningRed.png"));

              if(*alarmFlag[i] == 0)
              {
                *alarmFlag[i] = i + 2;
                errorLocalLogInfoDecode(word_str1);
              }
            }
          }
        }
        else
        {
          font.setPointSize(WORD_SIZE);
          MyMotor[i]->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          MyMotor[i]->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          MyMotor[i]->setPalette(color);
          MyMotor[i]->setAlignment(Qt::AlignCenter);

          MyMotorBnt[i]->setIcon(QIcon(":/image/chache/Warningblue.png"));

          if(*alarmFlag[i] == i+2)
          {
            *alarmFlag[i] = 0;
          }
        }
      }
    }
    //陀螺仪通讯警报
    if(gyro_s_.state.b.online == 0)// && AgvInit == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.Gyro->setFont(font);
        word_str = QString::fromLocal8Bit("陀螺仪掉线警报");
        ui.Gyro->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Gyro->setPalette(color);
        ui.Gyro->setAlignment(Qt::AlignCenter);

        ui.GyroBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.gyro_alarm_status == 0)
        {
          alarm_staus_.gyro_alarm_status = 7;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Gyro->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Gyro->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Gyro->setPalette(color);
        ui.Gyro->setAlignment(Qt::AlignCenter);

        ui.GyroBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.gyro_alarm_status = 0;
    }

    //打滑警报
    if(usb_robot_status_run_.agv_error.status.slip_status == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.Skidding->setFont(font);
        word_str = QString::fromLocal8Bit("打滑警报");
        ui.Skidding->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Skidding->setPalette(color);
        ui.Skidding->setAlignment(Qt::AlignCenter);

        ui.SkiddingBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.slip_status == 0)
        {
          alarm_staus_.slip_status = 8;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Skidding->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Skidding->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Skidding->setPalette(color);
        ui.Skidding->setAlignment(Qt::AlignCenter);

        ui.SkiddingBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));


        alarm_staus_.slip_status = 0;
    }


    //IO模块通讯状态
    if(IO_stauts.state.b.online == 0)// && AgvInit == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.IO->setFont(font);
        word_str = QString::fromLocal8Bit("IO模块通讯警报");
        ui.IO->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.IO->setPalette(color);
        ui.IO->setAlignment(Qt::AlignCenter);

        ui.IOBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.IO_alarm_status == 0)
        {
          alarm_staus_.IO_alarm_status = 9;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.IO->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.IO->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.IO->setPalette(color);
        ui.IO->setAlignment(Qt::AlignCenter);

        ui.IOBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.IO_alarm_status = 0;
    }

    //usb
    if((usb_robot_status_run_.agv_error.status.serial_status == 1 || from_arm_check_connection_error == 1))// && AgvInit == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.UsbAlarm->setFont(font);
        word_str = QString::fromLocal8Bit("主控通讯异常警报");
        ui.UsbAlarm->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.UsbAlarm->setPalette(color);
        ui.UsbAlarm->setAlignment(Qt::AlignCenter);

        ui.UsbAlarmBtn->setIcon(QIcon(":/image/chache/WarningRed.png"));

        QString alarmdata;
        alarmdata = QString::fromLocal8Bit("USB连接警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

        if(alarm_staus_.serial_status == 0)
        {
          alarm_staus_.serial_status = 10;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.UsbAlarm->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.UsbAlarm->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.UsbAlarm->setPalette(color);
        ui.UsbAlarm->setAlignment(Qt::AlignCenter);

        ui.UsbAlarmBtn->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.serial_status = 0;
    }

    //odom
    if(usb_robot_status_run_.agv_error.status.odom_status == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.OdomAlarm->setFont(font);
        word_str = QString::fromLocal8Bit("里程计错误警报");
        ui.OdomAlarm->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.OdomAlarm->setPalette(color);
        ui.OdomAlarm->setAlignment(Qt::AlignCenter);

        ui.OdomAlarmBtn->setIcon(QIcon(":/image/chache/WarningRed.png"));

        QString alarmdata;
        alarmdata = QString::fromLocal8Bit("弗洛伊德规划警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

        if(alarm_staus_.odom_status == 0)
        {
          alarm_staus_.odom_status = 11;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.OdomAlarm->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.OdomAlarm->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.OdomAlarm->setPalette(color);
        ui.OdomAlarm->setAlignment(Qt::AlignCenter);

        ui.OdomAlarmBtn->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.odom_status = 0;
    }


    //电池通讯状态
    if(battery_status_.state.b.online == 0)// && AgvInit == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.Battey->setFont(font);
        word_str = QString::fromLocal8Bit("电池通讯警报");
        ui.Battey->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Battey->setPalette(color);
        ui.Battey->setAlignment(Qt::AlignCenter);

        ui.BatteryBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.battery_alarm_status == 0)
        {
          alarm_staus_.battery_alarm_status = 12;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Battey->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Battey->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Battey->setPalette(color);
        ui.Battey->setAlignment(Qt::AlignCenter);

        ui.BatteryBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.battery_alarm_status = 0;
    }

    //避障雷达
    if(usb_robot_status_run_.agv_error.status.obstacle_radar_error == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.ObstacleRadar->setFont(font);
        word_str = QString::fromLocal8Bit("避障雷达错误警报");
        ui.ObstacleRadar->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.ObstacleRadar->setPalette(color);
        ui.ObstacleRadar->setAlignment(Qt::AlignCenter);

        ui.ObstacleRadarBtn->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.obstacle_radar_error == 0)
        {
          alarm_staus_.obstacle_radar_error = 13;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.ObstacleRadar->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.ObstacleRadar->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.ObstacleRadar->setPalette(color);
        ui.ObstacleRadar->setAlignment(Qt::AlignCenter);

        ui.ObstacleRadarBtn->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.obstacle_radar_error = 0;
    }

    //识别雷达
    if(usb_robot_status_run_.agv_error.status.scan_radar_error == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.CheckRadar->setFont(font);
        word_str = QString::fromLocal8Bit("识别雷达错误警报");
        ui.CheckRadar->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.CheckRadar->setPalette(color);
        ui.CheckRadar->setAlignment(Qt::AlignCenter);

        ui.CheckRadarBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.scan_radar_error == 0)
        {
          alarm_staus_.scan_radar_error = 14;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.CheckRadar->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.CheckRadar->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.CheckRadar->setPalette(color);
        ui.CheckRadar->setAlignment(Qt::AlignCenter);

        ui.CheckRadarBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.scan_radar_error = 0;
    }

    //导航雷达
    if(usb_robot_status_run_.agv_error.status.position_radar_error == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.PositionRadar->setFont(font);
        word_str = QString::fromLocal8Bit("导航雷达警报");
        ui.PositionRadar->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.PositionRadar->setPalette(color);
        ui.PositionRadar->setAlignment(Qt::AlignCenter);

        ui.PositionRadarBtn->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.position_radar_error == 0)
        {
          alarm_staus_.position_radar_error = 15;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.PositionRadar->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.PositionRadar->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.PositionRadar->setPalette(color);
        ui.PositionRadar->setAlignment(Qt::AlignCenter);

        ui.PositionRadarBtn->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.position_radar_error = 0;
    }

  //    ///////
  //    //相机状态
  //    if(pc_robot_status_run_.dev.b.camera == 1)
  //    {
  //        font.setPointSize(WORD_SIZE);
  //        ui.Camera->setFont(font);
  //        word_str = QString::fromLocal8Bit("相机状态警报");
  //        ui.Camera->setText(QString(word_str));                //显示页数
  //        color.setColor(QPalette::WindowText,Qt::red);
  //        ui.Camera->setPalette(color);
  //        ui.Camera->setAlignment(Qt::AlignCenter);

  //        ui.CameraBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));
  //    }
  //    else
  //    {
  //        font.setPointSize(WORD_SIZE);
  //        ui.Camera->setFont(font);
  //        word_str = QString::fromLocal8Bit("无警报");
  //        ui.Camera->setText(QString(word_str));                //显示页数
  //        color.setColor(QPalette::WindowText,Qt::green);
  //        ui.Camera->setPalette(color);
  //        ui.Camera->setAlignment(Qt::AlignCenter);

  //        ui.CameraBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));
  //    }


    //交通管制

  //    if(traffic != usb_robot_status_run_.agv_error.status.traffic)
  //    {
      if(usb_robot_status_run_.agv_error.status.traffic == 2)
      {
          font.setPointSize(WORD_SIZE);
          ui.Traffic->setFont(font);
          word_str = QString::fromLocal8Bit("交通管制警报!");
          ui.Traffic->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Traffic->setPalette(color);
          ui.Traffic->setAlignment(Qt::AlignCenter);

          ui.TrafficBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("交通管制警报!");

          if(alarm_staus_.traffic_alarm_status == 0)
          {
            alarm_staus_.traffic_alarm_status = 16;
  //            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Traffic->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Traffic->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Traffic->setPalette(color);
          ui.Traffic->setAlignment(Qt::AlignCenter);

          ui.TrafficBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.traffic_alarm_status = 0;
      }
  //    }

    //路径障碍检测
  //    if(nav_obstacle != usb_robot_status_run_.agv_error.status.nav_obstacle)
  //    {
      if(usb_robot_status_run_.agv_error.status.nav_obstacle != 0)
      {
          font.setPointSize(WORD_SIZE);
          ui.Obstacle->setFont(font);
          word_str = QString::fromLocal8Bit("路径障碍检测警报");
          ui.Obstacle->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Obstacle->setPalette(color);
          ui.Obstacle->setAlignment(Qt::AlignCenter);

          ui.ObstacleBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("路径障碍检测警报!");

  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.nav_obstacle == 0)
          {
            alarm_staus_.nav_obstacle = 17;
  //            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Obstacle->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Obstacle->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Obstacle->setPalette(color);
          ui.Obstacle->setAlignment(Qt::AlignCenter);

          ui.ObstacleBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.nav_obstacle = 0;
      }
  //    }

    //旋转障碍检测
  //    if(attitude_obstacle != usb_robot_status_run_.agv_error.status.attitude_obstacle)
  //    {
      if(usb_robot_status_run_.agv_error.status.attitude_obstacle != 0)
      {
          font.setPointSize(WORD_SIZE);
          ui.NavObstacle->setFont(font);
          word_str = QString::fromLocal8Bit("旋转障碍检测警报");
          ui.NavObstacle->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.NavObstacle->setPalette(color);
          ui.NavObstacle->setAlignment(Qt::AlignCenter);

          ui.NavObstacleBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("旋转障碍检测警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.attitude_obstacle == 0)
          {
            alarm_staus_.attitude_obstacle = 18;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.NavObstacle->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.NavObstacle->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.NavObstacle->setPalette(color);
          ui.NavObstacle->setAlignment(Qt::AlignCenter);

          ui.NavObstacleBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.attitude_obstacle = 0;
      }
  //    }



//    //网络连接
//  //    if(network != from_pc_check_net_connection)
//  //    {
//      if(from_pc_check_net_connection == 0 && AgvInit == 1)
//      {
//          font.setPointSize(WORD_SIZE);
//          ui.Netconnect->setFont(font);
//          word_str = QString::fromLocal8Bit("网络连接警报,网络连接为0");
//          ui.Netconnect->setText(QString(word_str));                //显示页数
//          color.setColor(QPalette::WindowText,Qt::red);
//          ui.Netconnect->setPalette(color);
//          ui.Netconnect->setAlignment(Qt::AlignCenter);

//          ui.NetconnectBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

//          QString alarmdata;
//          alarmdata = QString::fromLocal8Bit("网络连接警报!");
//  //          MyDatabaseSql.InsertAlarm(alarmdata);

//          if(alarm_staus_.netconnect_alarm_status == 0)
//          {
//            alarm_staus_.netconnect_alarm_status = 19;
//            errorLocalLogInfoDecode(word_str);
//          }
//      }
//      else
//      {
//          font.setPointSize(WORD_SIZE);
//          ui.Netconnect->setFont(font);
//          word_str = QString::fromLocal8Bit("无警报");
//          ui.Netconnect->setText(QString(word_str));                //显示页数
//          color.setColor(QPalette::WindowText,Qt::green);
//          ui.Netconnect->setPalette(color);
//          ui.Netconnect->setAlignment(Qt::AlignCenter);

//          ui.NetconnectBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));

//          alarm_staus_.netconnect_alarm_status = 0;

//      }
//  //    }

    //弗洛伊德规划失败
  //    if(floyd_fail != usb_robot_status_run_.agv_error.status.floyd_fail)
  //    {
      if(usb_robot_status_run_.agv_error.status.floyd_fail == 1)
      {
          font.setPointSize(WORD_SIZE);
          ui.Floyd->setFont(font);
          word_str = QString::fromLocal8Bit("弗洛伊德规划警报");
          ui.Floyd->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Floyd->setPalette(color);
          ui.Floyd->setAlignment(Qt::AlignCenter);

          ui.FloydBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("弗洛伊德规划警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.floyd_alarm_status == 0)
          {
            alarm_staus_.floyd_alarm_status = 20;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Floyd->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Floyd->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Floyd->setPalette(color);
          ui.Floyd->setAlignment(Qt::AlignCenter);

          ui.FloydBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.floyd_alarm_status = 0;
      }
  //    }

    //定位异常
  //    if(local_status != usb_robot_status_run_.agv_error.status.local_status)
  //    {
      //定位异常
  //    if(local_status != usb_robot_status_run_.agv_error.status.local_status)
  //    {
        if(usb_robot_status_run_.agv_error.status.local_status == 1)
        {
            font.setPointSize(WORD_SIZE);
            ui.LocalStatus->setFont(font);
            word_str = QString::fromLocal8Bit("无警报");
            ui.LocalStatus->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::green);
            ui.LocalStatus->setPalette(color);
            ui.LocalStatus->setAlignment(Qt::AlignCenter);

            ui.LocalStatusBtn->setIcon(QIcon(":/image/chache/Warningblue.png"));

            if(alarm_staus_.local_status == 0)
            {
              alarm_staus_.local_status = 21;
              errorLocalLogInfoDecode(word_str);
            }
        }
        else if(usb_robot_status_run_.agv_error.status.local_status == 0 && AgvInit == 1)
        {
          font.setPointSize(WORD_SIZE);
          ui.LocalStatus->setFont(font);
          word_str = QString::fromLocal8Bit("机器人未定位");
          ui.LocalStatus->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.LocalStatus->setPalette(color);
          ui.LocalStatus->setAlignment(Qt::AlignCenter);

          ui.LocalStatusBtn->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("定位异常警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.local_status == 0)
          {
            alarm_staus_.local_status = 21;
            errorLocalLogInfoDecode(word_str);
          }
        }
        else if(usb_robot_status_run_.agv_error.status.local_status == 2)
        {
          font.setPointSize(WORD_SIZE);
          ui.LocalStatus->setFont(font);
          word_str = QString::fromLocal8Bit("初始定位失败");
          ui.LocalStatus->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.LocalStatus->setPalette(color);
          ui.LocalStatus->setAlignment(Qt::AlignCenter);

          ui.LocalStatusBtn->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("定位异常警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.local_status == 0)
          {
            alarm_staus_.local_status = 21;
            errorLocalLogInfoDecode(word_str);
          }
        }
        else if(usb_robot_status_run_.agv_error.status.local_status == 3)
        {
          font.setPointSize(WORD_SIZE);
          ui.LocalStatus->setFont(font);
          word_str = QString::fromLocal8Bit("定位丢失警报");
          ui.LocalStatus->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.LocalStatus->setPalette(color);
          ui.LocalStatus->setAlignment(Qt::AlignCenter);

          ui.LocalStatusBtn->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("定位丢失警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          alarm_staus_.local_status = 0;
        }

        //二维码检测
        if(usb_robot_status_run_.agv_error.status.qr_code == 1)
        {
            font.setPointSize(WORD_SIZE);
            ui.Qrcode->setFont(font);
            word_str = QString::fromLocal8Bit("扫码枪异常警报");
            ui.Qrcode->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::red);
            ui.Qrcode->setPalette(color);
            ui.Qrcode->setAlignment(Qt::AlignCenter);

            ui.QrcodeBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));


            if(alarm_staus_.Qrcode_alarm_status == 0)
            {
              alarm_staus_.Qrcode_alarm_status = 22;
              errorLocalLogInfoDecode(word_str);
            }
        }
        if(usb_robot_status_run_.agv_error.status.qr_code == 2)
        {
            font.setPointSize(WORD_SIZE);
            ui.Qrcode->setFont(font);
            word_str = QString::fromLocal8Bit("二维码未识别警报");
            ui.Qrcode->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::red);
            ui.Qrcode->setPalette(color);
            ui.Qrcode->setAlignment(Qt::AlignCenter);

            ui.QrcodeBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

            if(alarm_staus_.Qrcode_alarm_status == 0)
            {
              alarm_staus_.Qrcode_alarm_status = 22;
              errorLocalLogInfoDecode(word_str);
            }
        }
        if(usb_robot_status_run_.agv_error.status.qr_code== 3)
        {
            font.setPointSize(WORD_SIZE);
            ui.Qrcode->setFont(font);
            word_str = QString::fromLocal8Bit("二维码错误警报");
            ui.Qrcode->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::red);
            ui.Qrcode->setPalette(color);
            ui.Qrcode->setAlignment(Qt::AlignCenter);

            ui.QrcodeBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));

            if(alarm_staus_.Qrcode_alarm_status == 0)
            {
              alarm_staus_.Qrcode_alarm_status = 22;
              errorLocalLogInfoDecode(word_str);
            }
        }
        else
        {
            font.setPointSize(WORD_SIZE);
            ui.Qrcode->setFont(font);
            word_str = QString::fromLocal8Bit("无警报");
            ui.Qrcode->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::green);
            ui.Qrcode->setPalette(color);
            ui.Qrcode->setAlignment(Qt::AlignCenter);

            ui.QrcodeBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));

            alarm_staus_.Qrcode_alarm_status = 0;
        }
  }
  else if(CarTypeStatus == 2)     //磁吸机器人界面显示
  {
    //急停拍下
    if(rtu317_CX.in.ch.bit0_emergency1 == 1 || rtu317_CX.in.ch.bit1_emergency2 == 1)
    {
        word_str = QString::fromLocal8Bit("急停按钮拍下!");

        if(alarm_staus_.emergency == 0)
        {
           alarm_staus_.emergency = 23;
           errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        word_str = QString::fromLocal8Bit("急停按钮松开");

        if(alarm_staus_.emergency == 23)
        {
           alarm_staus_.emergency = 0;
           errorLocalLogInfoDecode(word_str);
        }
    }

    //防撞条警报
    if(rtu317_CX.in.ch.bit3_impact== 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.impactalarm_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("防撞条警报");
        ui.impactalarm_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.impactalarm_Ma->setPalette(color);
        ui.impactalarm_Ma->setAlignment(Qt::AlignCenter);
        ui.impactbutton_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.impact_alarm_status == 0)
        {
           alarm_staus_.impact_alarm_status = 1;
           errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.impactalarm_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.impactalarm_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.impactalarm_Ma->setPalette(color);
        ui.impactalarm_Ma->setAlignment(Qt::AlignCenter);

        ui.impactbutton_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.impact_alarm_status == 1)
        {
           alarm_staus_.impact_alarm_status = 0;
           errorLocalLogInfoDecode(word_str);
        }
    }

    for(int i=0; i<4; i++)
    {
      if((Motor_re[i].errorCode != 0 && Motor_re[i].state.b.error == 1) || Motor_re[i].state.b.online == 0)
      {
        if(Motor_re[i].state.b.error == 1)
        {
          switch(Motor_re[i].errorCode)
          {
            case 2200:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("欠压警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//"电机1欠压警报";
            }break;

            case 2500:
            case 2501:
            case 2502:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("过流警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//
            }break;

            case 2510:
            case 2900:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("过载警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//
            }break;

            case 2520:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("超速警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//

            }break;

            case 2530:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("母线电压高警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//
            }break;

            case 2630:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("温度过高警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//
            }break;

            default :
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("未知报警:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;
            }break;
          }
        }
        else
        {
          word_str = QString::fromLocal8Bit("电机");
          word_str.append(QString::number(Motor_re[i].serialNum));
          word_str.append(QString::fromLocal8Bit("掉线"));
//          alarm_show_info_motro[i] = word_str;
        }

        QString initword;
        if(AgvInit == 1)
        {
          initword = QString::fromLocal8Bit("完成初始化,");
        }
        else
        {
          initword = QString::fromLocal8Bit("初始化中,");
        }
        QString front = QString::fromLocal8Bit("电机警报总共:");
        QString num = QString::number(Motor_re[0].count, 10);
        QString back = QString::fromLocal8Bit("次");

        QString word_str1 = initword + word_str + " " + front + num + back;

        font.setPointSize(WORD_SIZE);
        MyMotor[i]->setFont(font);
        MyMotor[i]->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        MyMotor[i]->setPalette(color);
        MyMotor[i]->setAlignment(Qt::AlignCenter);
        MyMotorBnt[i]->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(*alarmFlag[i] == 0)
        {
          *alarmFlag[i] = i + 2;
          errorLocalLogInfoDecode(word_str1);
        }
      }
      else
      {
        font.setPointSize(WORD_SIZE);
        MyMotor[i]->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        MyMotor[i]->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        MyMotor[i]->setPalette(color);
        MyMotor[i]->setAlignment(Qt::AlignCenter);

        MyMotorBnt[i]->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(*alarmFlag[i] == i+2)
        {
          *alarmFlag[i] = 0;
        }
      }
    }

    //陀螺仪通讯警报
    if(gyro_s_.state.b.online == 0)// && AgvInit == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.Gyro_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("陀螺仪掉线警报");
        ui.Gyro_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Gyro_Ma->setPalette(color);
        ui.Gyro_Ma->setAlignment(Qt::AlignCenter);

        ui.GyroBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.gyro_alarm_status == 0)
        {
          alarm_staus_.gyro_alarm_status = 7;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Gyro_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Gyro_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Gyro_Ma->setPalette(color);
        ui.Gyro_Ma->setAlignment(Qt::AlignCenter);

        ui.GyroBtu_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.gyro_alarm_status = 0;
    }

    //打滑警报
    if(usb_robot_status_run_.agv_error.status.slip_status == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.Skidding_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("打滑警报");
        ui.Skidding_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Skidding_Ma->setPalette(color);
        ui.Skidding_Ma->setAlignment(Qt::AlignCenter);

        ui.SkiddingBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.slip_status == 0)
        {
          alarm_staus_.slip_status = 8;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Skidding_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Skidding_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Skidding_Ma->setPalette(color);
        ui.Skidding_Ma->setAlignment(Qt::AlignCenter);

        ui.SkiddingBtu_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.slip_status = 0;

    }

    //IO模块通讯状态
    if(IO_stauts.state.b.online == 0)// && AgvInit == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.IO_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("IO模块通讯警报");
        ui.IO_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.IO_Ma->setPalette(color);
        ui.IO_Ma->setAlignment(Qt::AlignCenter);

        ui.IOBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.IO_alarm_status == 0)
        {
          alarm_staus_.IO_alarm_status = 9;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.IO_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.IO_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.IO_Ma->setPalette(color);
        ui.IO_Ma->setAlignment(Qt::AlignCenter);

        ui.IOBtu_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.IO_alarm_status = 0;
    }

    //usb
    if((usb_robot_status_run_.agv_error.status.serial_status == 1 || from_arm_check_connection_error == 1))// && AgvInit == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.UsbAlarm_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("主控通讯异常警报");
        ui.UsbAlarm_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.UsbAlarm_Ma->setPalette(color);
        ui.UsbAlarm_Ma->setAlignment(Qt::AlignCenter);

        ui.UsbAlarmBtn_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

        QString alarmdata;
        alarmdata = QString::fromLocal8Bit("USB连接警报!");
//          MyDatabaseSql.InsertAlarm(alarmdata);

        if(alarm_staus_.serial_status == 0)
        {
          alarm_staus_.serial_status = 10;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.UsbAlarm_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.UsbAlarm_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.UsbAlarm_Ma->setPalette(color);
        ui.UsbAlarm_Ma->setAlignment(Qt::AlignCenter);

        ui.UsbAlarmBtn_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.serial_status = 0;
    }

    //odom
    if(usb_robot_status_run_.agv_error.status.odom_status == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.OdomAlarm_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("里程计错误警报");
        ui.OdomAlarm_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.OdomAlarm_Ma->setPalette(color);
        ui.OdomAlarm_Ma->setAlignment(Qt::AlignCenter);

        ui.OdomAlarmBtn_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

        QString alarmdata;
        alarmdata = QString::fromLocal8Bit("弗洛伊德规划警报!");
//          MyDatabaseSql.InsertAlarm(alarmdata);

        if(alarm_staus_.odom_status == 0)
        {
          alarm_staus_.odom_status = 11;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.OdomAlarm_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.OdomAlarm_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.OdomAlarm_Ma->setPalette(color);
        ui.OdomAlarm_Ma->setAlignment(Qt::AlignCenter);

        ui.OdomAlarmBtn_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.odom_status = 0;
    }

    //电池通讯状态
    if(battery_status_.state.b.online == 0)// && AgvInit == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.Battey_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("电池通讯警报");
        ui.Battey_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Battey_Ma->setPalette(color);
        ui.Battey_Ma->setAlignment(Qt::AlignCenter);

        ui.BatteryBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.battery_alarm_status == 0)
        {
          alarm_staus_.battery_alarm_status = 12;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Battey_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Battey_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Battey_Ma->setPalette(color);
        ui.Battey_Ma->setAlignment(Qt::AlignCenter);

        ui.BatteryBtu_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.battery_alarm_status = 0;
    }

    //避障雷达
    if(usb_robot_status_run_.agv_error.status.obstacle_radar_error == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.ObstacleRadar_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("避障雷达错误警报");
        ui.ObstacleRadar_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.ObstacleRadar_Ma->setPalette(color);
        ui.ObstacleRadar_Ma->setAlignment(Qt::AlignCenter);

        ui.ObstacleRadarBtn_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.obstacle_radar_error == 0)
        {
          alarm_staus_.obstacle_radar_error = 13;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.ObstacleRadar_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.ObstacleRadar_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.ObstacleRadar_Ma->setPalette(color);
        ui.ObstacleRadar_Ma->setAlignment(Qt::AlignCenter);

        ui.ObstacleRadarBtn_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.obstacle_radar_error = 0;
    }

    //识别雷达
    if(usb_robot_status_run_.agv_error.status.scan_radar_error == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.CheckRadar_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("识别雷达错误警报");
        ui.CheckRadar_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.CheckRadar_Ma->setPalette(color);
        ui.CheckRadar_Ma->setAlignment(Qt::AlignCenter);

        ui.CheckRadarBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.scan_radar_error == 0)
        {
          alarm_staus_.scan_radar_error = 14;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.CheckRadar_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.CheckRadar_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.CheckRadar_Ma->setPalette(color);
        ui.CheckRadar_Ma->setAlignment(Qt::AlignCenter);

        ui.CheckRadarBtu_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.scan_radar_error = 0;
    }

    //导航雷达
    if(usb_robot_status_run_.agv_error.status.position_radar_error == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.PositionRadar_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("导航雷达警报");
        ui.PositionRadar_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.PositionRadar_Ma->setPalette(color);
        ui.PositionRadar_Ma->setAlignment(Qt::AlignCenter);

        ui.PositionRadarBtn_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.position_radar_error == 0)
        {
          alarm_staus_.position_radar_error = 15;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.PositionRadar_Ma->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.PositionRadar_Ma->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.PositionRadar_Ma->setPalette(color);
        ui.PositionRadar_Ma->setAlignment(Qt::AlignCenter);

        ui.PositionRadarBtn_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.position_radar_error = 0;
    }

//    ///////
//    //相机状态
//    if(pc_robot_status_run_.dev.b.camera == 1)
//    {
//        font.setPointSize(WORD_SIZE);
//        ui.Camera->setFont(font);
//        word_str = QString::fromLocal8Bit("相机状态警报");
//        ui.Camera->setText(QString(word_str));                //显示页数
//        color.setColor(QPalette::WindowText,Qt::red);
//        ui.Camera->setPalette(color);
//        ui.Camera->setAlignment(Qt::AlignCenter);

//        ui.CameraBtu->setIcon(QIcon(":/image/chache/WarningRed.png"));
//    }
//    else
//    {
//        font.setPointSize(WORD_SIZE);
//        ui.Camera->setFont(font);
//        word_str = QString::fromLocal8Bit("无警报");
//        ui.Camera->setText(QString(word_str));                //显示页数
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.Camera->setPalette(color);
//        ui.Camera->setAlignment(Qt::AlignCenter);

//        ui.CameraBtu->setIcon(QIcon(":/image/chache/Warningblue.png"));
//    }


    //交通管制

//    if(traffic != usb_robot_status_run_.agv_error.status.traffic)
//    {
      if(usb_robot_status_run_.agv_error.status.traffic == 2)
      {
          font.setPointSize(WORD_SIZE);
          ui.Traffic_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("交通管制警报!");
          ui.Traffic_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Traffic_Ma->setPalette(color);
          ui.Traffic_Ma->setAlignment(Qt::AlignCenter);

          ui.TrafficBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("交通管制警报!");

          if(alarm_staus_.traffic_alarm_status == 0)
          {
            alarm_staus_.traffic_alarm_status = 16;
//            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Traffic_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Traffic_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Traffic_Ma->setPalette(color);
          ui.Traffic_Ma->setAlignment(Qt::AlignCenter);

          ui.TrafficBtu_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.traffic_alarm_status = 0;
      }
//    }

    //路径障碍检测
//    if(nav_obstacle != usb_robot_status_run_.agv_error.status.nav_obstacle)
//    {
      if(usb_robot_status_run_.agv_error.status.nav_obstacle != 0)
      {
          font.setPointSize(WORD_SIZE);
          ui.Obstacle_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("路径障碍检测警报");
          ui.Obstacle_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Obstacle_Ma->setPalette(color);
          ui.Obstacle_Ma->setAlignment(Qt::AlignCenter);

          ui.ObstacleBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("路径障碍检测警报!");

//          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.nav_obstacle == 0)
          {
            alarm_staus_.nav_obstacle = 17;
//            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Obstacle_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Obstacle_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Obstacle_Ma->setPalette(color);
          ui.Obstacle_Ma->setAlignment(Qt::AlignCenter);

          ui.ObstacleBtu_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.nav_obstacle = 0;
      }
//    }

    //旋转障碍检测
//    if(attitude_obstacle != usb_robot_status_run_.agv_error.status.attitude_obstacle)
//    {
      if(usb_robot_status_run_.agv_error.status.attitude_obstacle != 0)
      {
          font.setPointSize(WORD_SIZE);
          ui.NavObstacle_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("旋转障碍检测警报");
          ui.NavObstacle_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.NavObstacle_Ma->setPalette(color);
          ui.NavObstacle_Ma->setAlignment(Qt::AlignCenter);

          ui.NavObstacleBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("旋转障碍检测警报!");
//          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.attitude_obstacle == 0)
          {
            alarm_staus_.attitude_obstacle = 18;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.NavObstacle_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.NavObstacle_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.NavObstacle_Ma->setPalette(color);
          ui.NavObstacle_Ma->setAlignment(Qt::AlignCenter);

          ui.NavObstacleBtu_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.attitude_obstacle = 0;
      }
//    }



    //网络连接
//    if(network != from_pc_check_net_connection)
//    {
      if(from_pc_check_net_connection == 0 && AgvInit == 1)
      {
          font.setPointSize(WORD_SIZE);
          ui.Netconnect_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("网络连接警报,网络连接为0");
          ui.Netconnect_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Netconnect_Ma->setPalette(color);
          ui.Netconnect_Ma->setAlignment(Qt::AlignCenter);

          ui.NetconnectBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("网络连接警报!");
//          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.netconnect_alarm_status == 0)
          {
            alarm_staus_.netconnect_alarm_status = 19;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Netconnect_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Netconnect_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Netconnect_Ma->setPalette(color);
          ui.Netconnect_Ma->setAlignment(Qt::AlignCenter);

          ui.NetconnectBtu_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.netconnect_alarm_status = 0;
      }
//    }

    //弗洛伊德规划失败
//    if(floyd_fail != usb_robot_status_run_.agv_error.status.floyd_fail)
//    {
      if(usb_robot_status_run_.agv_error.status.floyd_fail == 1)
      {
          font.setPointSize(WORD_SIZE);
          ui.Floyd_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("弗洛伊德规划警报");
          ui.Floyd_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Floyd_Ma->setPalette(color);
          ui.Floyd_Ma->setAlignment(Qt::AlignCenter);

          ui.FloydBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("弗洛伊德规划警报!");
//          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.floyd_alarm_status == 0)
          {
            alarm_staus_.floyd_alarm_status = 20;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Floyd_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Floyd_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Floyd_Ma->setPalette(color);
          ui.Floyd_Ma->setAlignment(Qt::AlignCenter);

          ui.FloydBtu_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.floyd_alarm_status = 0;
      }
//    }

    //定位异常
//    if(local_status != usb_robot_status_run_.agv_error.status.local_status)
//    {
      //定位异常
  //    if(local_status != usb_robot_status_run_.agv_error.status.local_status)
  //    {
        if(usb_robot_status_run_.agv_error.status.local_status == 1)
        {
            font.setPointSize(WORD_SIZE);
            ui.LocalStatus_Ma->setFont(font);
            word_str = QString::fromLocal8Bit("无警报");
            ui.LocalStatus_Ma->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::green);
            ui.LocalStatus_Ma->setPalette(color);
            ui.LocalStatus_Ma->setAlignment(Qt::AlignCenter);

            ui.LocalStatusBtn_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

            if(alarm_staus_.local_status == 0)
            {
              alarm_staus_.local_status = 21;
              errorLocalLogInfoDecode(word_str);
            }
        }
        else if(usb_robot_status_run_.agv_error.status.local_status == 0 && AgvInit == 1)
        {
          font.setPointSize(WORD_SIZE);
          ui.LocalStatus_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("机器人未定位");
          ui.LocalStatus_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.LocalStatus_Ma->setPalette(color);
          ui.LocalStatus_Ma->setAlignment(Qt::AlignCenter);

          ui.LocalStatusBtn_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("定位异常警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.local_status == 0)
          {
            alarm_staus_.local_status = 21;
            errorLocalLogInfoDecode(word_str);
          }
        }
        else if(usb_robot_status_run_.agv_error.status.local_status == 2)
        {
          font.setPointSize(WORD_SIZE);
          ui.LocalStatus_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("初始定位失败");
          ui.LocalStatus_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.LocalStatus_Ma->setPalette(color);
          ui.LocalStatus_Ma->setAlignment(Qt::AlignCenter);

          ui.LocalStatusBtn_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("定位异常警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.local_status == 0)
          {
            alarm_staus_.local_status = 21;
            errorLocalLogInfoDecode(word_str);
          }
        }
        else if(usb_robot_status_run_.agv_error.status.local_status == 3)
        {
          font.setPointSize(WORD_SIZE);
          ui.LocalStatus_Ma->setFont(font);
          word_str = QString::fromLocal8Bit("定位丢失警报");
          ui.LocalStatus_Ma->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.LocalStatus_Ma->setPalette(color);
          ui.LocalStatus_Ma->setAlignment(Qt::AlignCenter);

          ui.LocalStatusBtn_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("定位丢失警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          alarm_staus_.local_status = 0;
        }
//    }

        //二维码检测
        if(usb_robot_status_run_.agv_error.status.qr_code == 1)
        {
            font.setPointSize(WORD_SIZE);
            ui.Qrcode_Ma->setFont(font);
            word_str = QString::fromLocal8Bit("扫码枪异常警报");
            ui.Qrcode_Ma->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::red);
            ui.Qrcode_Ma->setPalette(color);
            ui.Qrcode_Ma->setAlignment(Qt::AlignCenter);

            ui.QrcodeBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));


            if(alarm_staus_.Qrcode_alarm_status == 0)
            {
              alarm_staus_.Qrcode_alarm_status = 22;
              errorLocalLogInfoDecode(word_str);
            }
        }
        if(usb_robot_status_run_.agv_error.status.qr_code == 2)
        {
            font.setPointSize(WORD_SIZE);
            ui.Qrcode_Ma->setFont(font);
            word_str = QString::fromLocal8Bit("二维码未识别警报");
            ui.Qrcode_Ma->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::red);
            ui.Qrcode_Ma->setPalette(color);
            ui.Qrcode_Ma->setAlignment(Qt::AlignCenter);

            ui.QrcodeBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

            if(alarm_staus_.Qrcode_alarm_status == 0)
            {
              alarm_staus_.Qrcode_alarm_status = 22;
              errorLocalLogInfoDecode(word_str);
            }
        }
        if(usb_robot_status_run_.agv_error.status.qr_code== 3)
        {
            font.setPointSize(WORD_SIZE);
            ui.Qrcode_Ma->setFont(font);
            word_str = QString::fromLocal8Bit("二维码错误警报");
            ui.Qrcode_Ma->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::red);
            ui.Qrcode_Ma->setPalette(color);
            ui.Qrcode_Ma->setAlignment(Qt::AlignCenter);

            ui.QrcodeBtu_Ma->setIcon(QIcon(":/image/chache/WarningRed.png"));

            if(alarm_staus_.Qrcode_alarm_status == 0)
            {
              alarm_staus_.Qrcode_alarm_status = 22;
              errorLocalLogInfoDecode(word_str);
            }
        }
        else
        {
            font.setPointSize(WORD_SIZE);
            ui.Qrcode_Ma->setFont(font);
            word_str = QString::fromLocal8Bit("无警报");
            ui.Qrcode_Ma->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::green);
            ui.Qrcode_Ma->setPalette(color);
            ui.Qrcode_Ma->setAlignment(Qt::AlignCenter);

            ui.QrcodeBtu_Ma->setIcon(QIcon(":/image/chache/Warningblue.png"));

            alarm_staus_.Qrcode_alarm_status = 0;
        }

//        if((rtu317.in.ch.bit3_swCloseLimit == 1 || rtu317.in.ch.bit5_swClose == 1) &&
//           (rtu317.in.ch.bit2_swOpenLimit == 1 || rtu317.in.ch.bit4_swOpen == 1))
//        {
//          font.setPointSize(WORD_SIZE);
//          word_str = QString::fromLocal8Bit("前后到位、极限传感器同时触发报警");
//          ui.AlarmHandleLa->setFont(font);
//          ui.AlarmHandleLa->setText(QString(word_str));                //显示页数
//          ui.AlarmHandleLa->setAlignment(Qt::AlignCenter);
//          color.setColor(QPalette::WindowText,Qt::red);
//          ui.AlarmHandleLa->setPalette(color);

//          if(alarm_staus_.close_open_limit == 0)
//          {
//            alarm_staus_.close_open_limit = 24;
//            errorLocalLogInfoDecode(word_str);

//            if(ledStatus == 1 && ledStatusReal == 0)
//            {
//              ledStatusReal = 24;
//            }
//          }

//          if(ledStatusReal == 24)
//          {
//            if(timecount % 10 == 0)
//            {
//              ledAlarmShowFront(word_str);
//            }
//            else if(timecount % 15 == 0)
//            {
//              ledAlarmShowBack(word_str);
//            }
//          }
//        }
//        else
//        {
//          font.setPointSize(WORD_SIZE);
//          word_str = QString::fromLocal8Bit("无警报");
//          ui.AlarmHandleLa->setFont(font);
//          ui.AlarmHandleLa->setText(QString(word_str));                //显示页数
//          ui.AlarmHandleLa->setAlignment(Qt::AlignCenter);
//          color.setColor(QPalette::WindowText,Qt::red);
//          ui.AlarmHandleLa->setPalette(color);

//          alarm_staus_.close_open_limit = 0;

//          if(ledStatus == 1 && ledStatusReal == 24)
//          {
//            ledStatusReal = 0;
//          }
//        }
  }
  else if(CarTypeStatus == 3)
  {
    QPalette color;
    QString word_str;
    QFont font;

    //急停拍下
    if(rtu3170.in.ch.bit0_emergentStop1 == 1 || rtu3170.in.ch.bit1_emergentStop2 == 1 || rtu3170.in.ch.bit2_emergentStop3 == 1)
    {
        word_str = QString::fromLocal8Bit("急停按钮拍下!");

        if(alarm_staus_.emergency == 0)
        {
           alarm_staus_.emergency = 23;
           errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {

        word_str = QString::fromLocal8Bit("急停按钮松开");

        if(alarm_staus_.emergency == 23)
        {
           alarm_staus_.emergency = 0;
           errorLocalLogInfoDecode(word_str);
        }
    }

    //防撞条警报
    if(rtu3170.in.ch.bit5_impact== 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.impactalarm_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("防撞条警报");
        ui.impactalarm_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.impactalarm_Semi->setPalette(color);
        ui.impactalarm_Semi->setAlignment(Qt::AlignCenter);
        ui.impactbutton_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.impact_alarm_status == 0)
        {
           alarm_staus_.impact_alarm_status = 1;
           errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.impactalarm_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.impactalarm_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.impactalarm_Semi->setPalette(color);
        ui.impactalarm_Semi->setAlignment(Qt::AlignCenter);

        ui.impactbutton_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.impact_alarm_status == 1)
        {
           alarm_staus_.impact_alarm_status = 0;
           errorLocalLogInfoDecode(word_str);
        }
    }

    //电机报警信息
    //  if(AgvInit == 1)
    {

      for(int i=0; i<6; i++)
      {
        if((Motor_re[i].errorCode != 0 && Motor_re[i].state.b.error == 1) || Motor_re[i].state.b.online == 0)
        {
          if(Motor_re[i].state.b.error == 1)
          {
            switch(Motor_re[i].errorCode)
            {
              case 2200:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("欠压警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//"电机1欠压警报";
              }break;

              case 2500:
              case 2501:
              case 2502:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("过流警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//
              }break;

              case 2510:
              case 2900:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("过载警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//
              }break;

              case 2520:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("超速警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//

              }break;

              case 2530:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("母线电压高警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//
              }break;

              case 2630:
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("温度过高警报:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;//
              }break;

              default :
              {
                word_str = QString::fromLocal8Bit("电机");
                word_str.append(QString::number(Motor_re[i].serialNum));
                word_str.append(QString::fromLocal8Bit("未知报警:"));
                word_str.append(QString::number(Motor_re[i].errorCode));
  //              alarm_show_info_motro[i] = word_str;
              }break;
            }
          }
          else
          {
            word_str = QString::fromLocal8Bit("电机");
            word_str.append(QString::number(Motor_re[i].serialNum));
            word_str.append(QString::fromLocal8Bit("掉线"));
  //          alarm_show_info_motro[i] = word_str;
          }

  //        qDebug("motor num = %d", i);
          QString initword;
          if(AgvInit == 1)
          {
            initword = QString::fromLocal8Bit("完成初始化,");
          }
          else
          {
            initword = QString::fromLocal8Bit("初始化中,");
          }
          QString front = QString::fromLocal8Bit("电机警报总共:");
          QString num = QString::number(Motor_re[0].count, 10);
          QString back = QString::fromLocal8Bit("次");

          QString word_str1 = initword + word_str + " " + front + num + back;

          font.setPointSize(WORD_SIZE);
          MyMotor[i]->setFont(font);
          MyMotor[i]->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          MyMotor[i]->setPalette(color);
          MyMotor[i]->setAlignment(Qt::AlignCenter);
          MyMotorBnt[i]->setIcon(QIcon(":/image/chache/WarningRed.png"));

          if(*alarmFlag[i] == 0)
          {
            *alarmFlag[i] = i + 2;
            errorLocalLogInfoDecode(word_str1);
          }
        }
        else
        {
          font.setPointSize(WORD_SIZE);
          MyMotor[i]->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          MyMotor[i]->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          MyMotor[i]->setPalette(color);
          MyMotor[i]->setAlignment(Qt::AlignCenter);

          MyMotorBnt[i]->setIcon(QIcon(":/image/chache/Warningblue.png"));

          if(*alarmFlag[i] == i+2)
          {
            *alarmFlag[i] = 0;
          }
        }
      }
    }

    //陀螺仪通讯警报
    if(gyro_s_.state.b.online == 0)
    {
        font.setPointSize(WORD_SIZE);
        ui.Gyro_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("陀螺仪掉线警报");
        ui.Gyro_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Gyro_Semi->setPalette(color);
        ui.Gyro_Semi->setAlignment(Qt::AlignCenter);

        ui.GyroBtu_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.gyro_alarm_status == 0)
        {
          alarm_staus_.gyro_alarm_status = 7;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Gyro_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Gyro_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Gyro_Semi->setPalette(color);
        ui.Gyro_Semi->setAlignment(Qt::AlignCenter);

        ui.GyroBtu_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.gyro_alarm_status == 7)
        {
          alarm_staus_.gyro_alarm_status = 0;
        }
    }

    //打滑警报
    if(usb_robot_status_run_.agv_error.status.slip_status == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.Skidding_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("打滑警报");
        ui.Skidding_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Skidding_Semi->setPalette(color);
        ui.Skidding_Semi->setAlignment(Qt::AlignCenter);

        ui.SkiddingBtu_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.slip_status == 0)
        {
          alarm_staus_.slip_status = 8;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Skidding_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Skidding_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Skidding_Semi->setPalette(color);
        ui.Skidding_Semi->setAlignment(Qt::AlignCenter);

        ui.SkiddingBtu_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.slip_status == 8)
        {
          alarm_staus_.slip_status = 0;
        }
    }
    //IO模块通讯状态
    if(IO_stauts.state.b.error == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.IO_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("IO模块1通讯警报");
        ui.IO_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.IO_Semi->setPalette(color);
        ui.IO_Semi->setAlignment(Qt::AlignCenter);

        ui.IOBtu_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.IO_alarm_status == 0)
        {
          alarm_staus_.IO_alarm_status = 9;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else if(IO_stauts.state.b.error == 2)
    {
        font.setPointSize(WORD_SIZE);
        ui.IO_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("IO模块2通讯警报");
        ui.IO_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.IO_Semi->setPalette(color);
        ui.IO_Semi->setAlignment(Qt::AlignCenter);

        ui.IOBtu_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.IO_alarm_status == 0)
        {
          alarm_staus_.IO_alarm_status = 9;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.IO_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.IO_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.IO_Semi->setPalette(color);
        ui.IO_Semi->setAlignment(Qt::AlignCenter);

        ui.IOBtu_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.IO_alarm_status == 9)
        {
          alarm_staus_.IO_alarm_status = 0;
        }
    }

    //顶升
    if(agv_sw_state_.state.b.jackFlag == 0)
    {
        font.setPointSize(WORD_SIZE);
        ui.JackUp_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("顶升状态警报");
        ui.JackUp_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.JackUp_Semi->setPalette(color);
        ui.JackUp_Semi->setAlignment(Qt::AlignCenter);

        ui.JackUpBtn_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.jackupdown == 0)
        {
          alarm_staus_.jackupdown = 24;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.JackUp_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.JackUp_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.JackUp_Semi->setPalette(color);
        ui.JackUp_Semi->setAlignment(Qt::AlignCenter);

        ui.JackUpBtn_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.jackupdown == 24)
        {
          alarm_staus_.jackupdown = 0;
        }

    }

//    //usb
//    if(usb_robot_status_run_.logic.status.serial_status == 1)
//    {
//        font.setPointSize(WORD_SIZE);
//        ui.UsbAlarm->setFont(font);
//        word_str = QString::fromLocal8Bit("USB连接警报");
//        ui.UsbAlarm->setText(QString(word_str));                //显示页数
//        color.setColor(QPalette::WindowText,Qt::red);
//        ui.UsbAlarm->setPalette(color);
//        ui.UsbAlarm->setAlignment(Qt::AlignCenter);

//        ui.UsbAlarmBtn->setIcon(QIcon(":/image/chache/WarningRed.png"));

//        QString alarmdata;
//        alarmdata = QString::fromLocal8Bit("USB连接警报!");
////          MyDatabaseSql.InsertAlarm(alarmdata);

//        if(alarm_staus_.serial_status == 0)
//        {
//          alarm_staus_.serial_status = 10;
//          errorLocalLogInfoDecode(word_str);
//        }
//    }
//    else
//    {
//        font.setPointSize(WORD_SIZE);
//        ui.UsbAlarm->setFont(font);
//        word_str = QString::fromLocal8Bit("无警报");
//        ui.UsbAlarm->setText(QString(word_str));                //显示页数
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.UsbAlarm->setPalette(color);
//        ui.UsbAlarm->setAlignment(Qt::AlignCenter);

//        ui.UsbAlarmBtn->setIcon(QIcon(":/image/chache/Warningblue.png"));

//        alarm_staus_.serial_status = 0;
//    }

//    //odom
//    if(usb_robot_status_run_.agv_error.status.odom_status == 1)
//    {
//        font.setPointSize(WORD_SIZE);
//        ui.OdomAlarm->setFont(font);
//        word_str = QString::fromLocal8Bit("里程计错误警报");
//        ui.OdomAlarm->setText(QString(word_str));                //显示页数
//        color.setColor(QPalette::WindowText,Qt::red);
//        ui.OdomAlarm->setPalette(color);
//        ui.OdomAlarm->setAlignment(Qt::AlignCenter);

//        ui.OdomAlarmBtn->setIcon(QIcon(":/image/chache/WarningRed.png"));

//        QString alarmdata;
//        alarmdata = QString::fromLocal8Bit("弗洛伊德规划警报!");

//        if(alarm_staus_.odom_status == 0)
//        {
//          alarm_staus_.odom_status = 11;
//          errorLocalLogInfoDecode(word_str);
//        }
//    }
//    else
//    {
//        font.setPointSize(WORD_SIZE);
//        ui.OdomAlarm->setFont(font);
//        word_str = QString::fromLocal8Bit("无警报");
//        ui.OdomAlarm->setText(QString(word_str));                //显示页数
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.OdomAlarm->setPalette(color);
//        ui.OdomAlarm->setAlignment(Qt::AlignCenter);

//        ui.OdomAlarmBtn->setIcon(QIcon(":/image/chache/Warningblue.png"));

//          alarm_staus_.odom_status = 0;
//    }


    //电池通讯状态
    if(battery_status_.state.b.online == 0)
    {
        font.setPointSize(WORD_SIZE);
        ui.Battey_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("电池通讯警报");
        ui.Battey_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Battey_Semi->setPalette(color);
        ui.Battey_Semi->setAlignment(Qt::AlignCenter);

        ui.BatteryBtu_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.battery_alarm_status == 0)
        {
          alarm_staus_.battery_alarm_status = 12;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Battey_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Battey_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Battey_Semi->setPalette(color);
        ui.Battey_Semi->setAlignment(Qt::AlignCenter);

        ui.BatteryBtu_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.battery_alarm_status == 12)
        {
          alarm_staus_.battery_alarm_status = 0;
        }

    }

    //导航雷达
    if(usb_robot_status_run_.agv_error.status.scan_radar_error == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.PositionRadar_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("导航雷达警报");
        ui.PositionRadar_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.PositionRadar_Semi->setPalette(color);
        ui.PositionRadar_Semi->setAlignment(Qt::AlignCenter);

        ui.PositionRadarBtn_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.position_radar_error == 0)
        {
          alarm_staus_.position_radar_error = 15;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.PositionRadar_Semi->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.PositionRadar_Semi->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.PositionRadar_Semi->setPalette(color);
        ui.PositionRadar_Semi->setAlignment(Qt::AlignCenter);

        ui.PositionRadarBtn_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.position_radar_error == 15)
        {
          alarm_staus_.position_radar_error = 0;
//            errorLocalLogInfoDecode(word_str);
        }

    }
    //交通管制
//    if(traffic != usb_robot_status_run_.agv_error.status.traffic)
//    {
      if(usb_robot_status_run_.agv_error.status.traffic == 2)
      {
          font.setPointSize(WORD_SIZE);
          ui.Traffic_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("交通管制警报!");
          ui.Traffic_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Traffic_Semi->setPalette(color);
          ui.Traffic_Semi->setAlignment(Qt::AlignCenter);

          ui.TrafficBtu_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("交通管制警报!");
          if(alarm_staus_.traffic_alarm_status == 0)
          {
            alarm_staus_.traffic_alarm_status = 16;
//            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Traffic_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Traffic_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Traffic_Semi->setPalette(color);
          ui.Traffic_Semi->setAlignment(Qt::AlignCenter);

          ui.TrafficBtu_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.traffic_alarm_status = 0;
      }
//    }

    //路径障碍检测
//    if(nav_obstacle != usb_robot_status_run_.agv_error.status.nav_obstacle)
//    {
      if(usb_robot_status_run_.agv_error.status.nav_obstacle != 0)
      {
          font.setPointSize(WORD_SIZE);
          ui.Obstacle_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("路径障碍检测警报");
          ui.Obstacle_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Obstacle_Semi->setPalette(color);
          ui.Obstacle_Semi->setAlignment(Qt::AlignCenter);

          ui.ObstacleBtu_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("路径障碍检测警报!");
          if(alarm_staus_.nav_obstacle == 0)
          {
            alarm_staus_.nav_obstacle = 17;
//            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Obstacle_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Obstacle_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Obstacle_Semi->setPalette(color);
          ui.Obstacle_Semi->setAlignment(Qt::AlignCenter);

          ui.ObstacleBtu_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

          if(alarm_staus_.nav_obstacle == 17)
          {
            alarm_staus_.nav_obstacle = 0;
          }

      }
//    }

    //旋转障碍检测
//    if(attitude_obstacle != usb_robot_status_run_.agv_error.status.attitude_obstacle)
//    {
      if(usb_robot_status_run_.agv_error.status.attitude_obstacle != 0)
      {
          font.setPointSize(WORD_SIZE);
          ui.NavObstacle_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("旋转障碍检测警报");
          ui.NavObstacle_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.NavObstacle_Semi->setPalette(color);
          ui.NavObstacle_Semi->setAlignment(Qt::AlignCenter);

          ui.NavObstacleBtu_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("旋转障碍检测警报!");

          if(alarm_staus_.attitude_obstacle == 0)
          {
            alarm_staus_.attitude_obstacle = 18;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.NavObstacle_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.NavObstacle_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.NavObstacle_Semi->setPalette(color);
          ui.NavObstacle_Semi->setAlignment(Qt::AlignCenter);

          ui.NavObstacleBtu_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

          if(alarm_staus_.attitude_obstacle == 18)
          {
            alarm_staus_.attitude_obstacle = 0;
          }

      }
//    }

    //网络连接
//    if(network != from_pc_check_net_connection)
//    {
      if(from_pc_check_net_connection == 0)
      {
          font.setPointSize(WORD_SIZE);
          ui.Netconnect_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("服务器状态警报");
          ui.Netconnect_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Netconnect_Semi->setPalette(color);
          ui.Netconnect_Semi->setAlignment(Qt::AlignCenter);

          ui.NetconnectBtu_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("网络连接警报!");
//          MyDatabaseSql.InsertAlarm(alarmdata);

          if(alarm_staus_.netconnect_alarm_status == 0)
          {
            alarm_staus_.netconnect_alarm_status = 19;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Netconnect_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Netconnect_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Netconnect_Semi->setPalette(color);
          ui.Netconnect_Semi->setAlignment(Qt::AlignCenter);

          ui.NetconnectBtu_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

          if(alarm_staus_.netconnect_alarm_status == 19)
          {
            alarm_staus_.netconnect_alarm_status = 0;
          }

      }
//    }

    //弗洛伊德规划失败
//    if(floyd_fail != usb_robot_status_run_.agv_error.status.floyd_fail)
//    {
      if(usb_robot_status_run_.agv_error.status.floyd_fail == 1)
      {
          font.setPointSize(WORD_SIZE);
          ui.Floyd_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("弗洛伊德规划警报");
          ui.Floyd_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Floyd_Semi->setPalette(color);
          ui.Floyd_Semi->setAlignment(Qt::AlignCenter);

          ui.FloydBtu_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("弗洛伊德规划警报!");

          if(alarm_staus_.floyd_alarm_status == 0)
          {
            alarm_staus_.floyd_alarm_status = 20;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Floyd_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Floyd_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Floyd_Semi->setPalette(color);
          ui.Floyd_Semi->setAlignment(Qt::AlignCenter);

          ui.FloydBtu_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

          if(alarm_staus_.floyd_alarm_status == 20)
          {
            alarm_staus_.floyd_alarm_status = 0;
          }

      }
//    }

    //定位异常
//    if(local_status != usb_robot_status_run_.agv_error.status.local_status)
//    {
      //定位异常
  //    if(local_status != usb_robot_status_run_.agv_error.status.local_status)
  //    {
        if(usb_robot_status_run_.agv_error.status.local_status == 1)
        {
            font.setPointSize(WORD_SIZE);
            ui.LocalStatus_Semi->setFont(font);
            word_str = QString::fromLocal8Bit("无警报");
            ui.LocalStatus_Semi->setText(QString(word_str));                //显示页数
            color.setColor(QPalette::WindowText,Qt::green);
            ui.LocalStatus_Semi->setPalette(color);
            ui.LocalStatus_Semi->setAlignment(Qt::AlignCenter);

            ui.LocalStatusBtn_Semi->setIcon(QIcon(":/image/chache/Warningblue.png"));

            if(alarm_staus_.local_status == 0)
            {
              alarm_staus_.local_status = 21;
              errorLocalLogInfoDecode(word_str);
            }
        }
        else if(usb_robot_status_run_.agv_error.status.local_status == 0)
        {
          font.setPointSize(WORD_SIZE);
          ui.LocalStatus_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("机器人未定位");
          ui.LocalStatus_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.LocalStatus_Semi->setPalette(color);
          ui.LocalStatus_Semi->setAlignment(Qt::AlignCenter);

          ui.LocalStatusBtn_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("定位异常警报!");
          if(alarm_staus_.local_status == 0)
          {
            alarm_staus_.local_status = 21;
            errorLocalLogInfoDecode(word_str);
          }
        }
        else if(usb_robot_status_run_.agv_error.status.local_status == 2)
        {
          font.setPointSize(WORD_SIZE);
          ui.LocalStatus_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("初始定位失败");
          ui.LocalStatus_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.LocalStatus_Semi->setPalette(color);
          ui.LocalStatus_Semi->setAlignment(Qt::AlignCenter);

          ui.LocalStatusBtn_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("定位异常警报!");

          if(alarm_staus_.local_status == 0)
          {
            alarm_staus_.local_status = 21;
            errorLocalLogInfoDecode(word_str);
          }
        }
        else if(usb_robot_status_run_.agv_error.status.local_status == 3)
        {
          font.setPointSize(WORD_SIZE);
          ui.LocalStatus_Semi->setFont(font);
          word_str = QString::fromLocal8Bit("定位丢失警报");
          ui.LocalStatus_Semi->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.LocalStatus_Semi->setPalette(color);
          ui.LocalStatus_Semi->setAlignment(Qt::AlignCenter);

          ui.LocalStatusBtn_Semi->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("定位丢失警报!");

          if(alarm_staus_.local_status == 21)
          {
            alarm_staus_.local_status = 0;
          }
        }
  }
  else if(CarTypeStatus == 4 || CarTypeStatus == 5)
  {
    //防撞条警报
    if(rtu3072.ch.bit10_impact== 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.impact_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("防撞条警报");
        ui.impact_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.impact_Cotton->setPalette(color);
        ui.impact_Cotton->setAlignment(Qt::AlignCenter);
        ui.impactbutton_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.impact_alarm_status == 0)
        {
           alarm_staus_.impact_alarm_status = 1;
           errorLocalLogInfoDecode(word_str);
        }
  //      alarm_staus_.impact_alarm_status = 1;
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.impact_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.impact_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.impact_Cotton->setPalette(color);
        ui.impact_Cotton->setAlignment(Qt::AlignCenter);

        ui.impactbutton_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.impact_alarm_status = 1)
        {
          alarm_staus_.impact_alarm_status = 0;
        }
    }

  //网络连接
    if(from_pc_check_net_connection == 0 && AgvInit == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.Netconnect_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("网络连接警报");
        ui.Netconnect_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Netconnect_Cotton->setPalette(color);
        ui.Netconnect_Cotton->setAlignment(Qt::AlignCenter);

        ui.NetconnectBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

        QString alarmdata;
        alarmdata = QString::fromLocal8Bit("网络连接警报!");
//          MyDatabaseSql.InsertAlarm(alarmdata);

        if(alarm_staus_.netconnect_alarm_status == 0)
        {
          alarm_staus_.netconnect_alarm_status = 19;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Netconnect_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Netconnect_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Netconnect_Cotton->setPalette(color);
        ui.Netconnect_Cotton->setAlignment(Qt::AlignCenter);

        ui.NetconnectBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.netconnect_alarm_status = 0;

    }

    for(int i=0; i<MOTOR_NUM_T; i++)
//    for(int i=0; i<MOTOR_NUM; i++)
    {
      if((Motor_re[i].errorCode != 0 && Motor_re[i].state.b.error == 1) || Motor_re[i].state.b.online == 0)
      {
        if(Motor_re[i].state.b.error == 1)
        {
          switch(Motor_re[i].errorCode)
          {
            case 2200:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("欠压警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//"电机1欠压警报";
            }break;

            case 2500:
            case 2501:
            case 2502:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("过流警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//
            }break;

            case 2510:
            case 2900:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("过载警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//
            }break;

            case 2520:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("超速警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//

            }break;

            case 2530:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("母线电压高警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//
            }break;

            case 2630:
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("温度过高警报:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;//
            }break;

            default :
            {
              word_str = QString::fromLocal8Bit("电机");
              word_str.append(QString::number(Motor_re[i].serialNum));
              word_str.append(QString::fromLocal8Bit("未知报警:"));
              word_str.append(QString::number(Motor_re[i].errorCode));
//              alarm_show_info_motro[i] = word_str;
            }break;
          }
        }
        else
        {
          word_str = QString::fromLocal8Bit("电机");
          word_str.append(QString::number(Motor_re[i].serialNum));
          word_str.append(QString::fromLocal8Bit("掉线"));
//          alarm_show_info_motro[i] = word_str;
        }

//        qDebug("motor num = %d", i);
        QString initword;
        if(AgvInit == 1)
        {
          initword = QString::fromLocal8Bit("完成初始化,");
        }
        else
        {
          initword = QString::fromLocal8Bit("初始化中,");
        }
        QString front = QString::fromLocal8Bit("电机警报总共:");
        QString num = QString::number(Motor_re[0].count, 10);
        QString back = QString::fromLocal8Bit("次");

        QString word_str1 = initword + word_str + " " + front + num + back;

        font.setPointSize(WORD_SIZE);
        MyMotor[i]->setFont(font);
        MyMotor[i]->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        MyMotor[i]->setPalette(color);
        MyMotor[i]->setAlignment(Qt::AlignCenter);
        MyMotorBnt[i]->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(*alarmFlag[i] == 0)
        {
          *alarmFlag[i] = i + 2;
          errorLocalLogInfoDecode(word_str1);
        }
      }
      else
      {
        font.setPointSize(WORD_SIZE);
        MyMotor[i]->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        MyMotor[i]->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        MyMotor[i]->setPalette(color);
        MyMotor[i]->setAlignment(Qt::AlignCenter);

        MyMotorBnt[i]->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(*alarmFlag[i] == i+2)
        {
          *alarmFlag[i] = 0;
        }
      }
    }

    //陀螺仪通讯警报
    if(gyro_s_.state.b.online == 0)// && AgvInit == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.Gyro_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("陀螺仪掉线警报");
        ui.Gyro_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Gyro_Cotton->setPalette(color);
        ui.Gyro_Cotton->setAlignment(Qt::AlignCenter);

        ui.GyroBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.gyro_alarm_status == 0)
        {
          alarm_staus_.gyro_alarm_status = 7;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Gyro_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Gyro_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Gyro_Cotton->setPalette(color);
        ui.Gyro_Cotton->setAlignment(Qt::AlignCenter);

        ui.GyroBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.gyro_alarm_status = 0;
    }

    //IO模块通讯状态
    if(IO_stauts.state.b.online == 0)
    {
        font.setPointSize(WORD_SIZE);
        ui.IO_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("IO模块通讯警报");
        ui.IO_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.IO_Cotton->setPalette(color);
        ui.IO_Cotton->setAlignment(Qt::AlignCenter);

        ui.IOBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.IO_alarm_status == 0)
        {
          alarm_staus_.IO_alarm_status = 8;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.IO_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.IO_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.IO_Cotton->setPalette(color);
        ui.IO_Cotton->setAlignment(Qt::AlignCenter);

        ui.IOBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.IO_alarm_status == 8)
        {
          alarm_staus_.IO_alarm_status = 0;
        }
    }

    //电池通讯状态
    if(battery_status_.state.b.online == 0)
    {
        font.setPointSize(WORD_SIZE);
        ui.Battey_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("电池通讯警报");
        ui.Battey_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Battey_Cotton->setPalette(color);
        ui.Battey_Cotton->setAlignment(Qt::AlignCenter);

        ui.BatteryBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.battery_alarm_status == 0)
        {
          alarm_staus_.battery_alarm_status = 9;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Battey_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Battey_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Battey_Cotton->setPalette(color);
        ui.Battey_Cotton->setAlignment(Qt::AlignCenter);

        ui.BatteryBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.battery_alarm_status == 9)
        {
          alarm_staus_.battery_alarm_status = 0;
        }
    }

    //避障雷达
    if(usb_robot_status_run_.agv_error.status.obstacle_radar_error == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.ObstacleRadar_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("避障雷达警报");
        ui.ObstacleRadar_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.ObstacleRadar_Cotton->setPalette(color);
        ui.ObstacleRadar_Cotton->setAlignment(Qt::AlignCenter);

        ui.ObstacleRadarBtn_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.obstacle_radar_error == 0)
        {
          alarm_staus_.obstacle_radar_error = 13;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.ObstacleRadar_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.ObstacleRadar_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.ObstacleRadar_Cotton->setPalette(color);
        ui.ObstacleRadar_Cotton->setAlignment(Qt::AlignCenter);

        ui.ObstacleRadarBtn_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.obstacle_radar_error == 13)
        {
          alarm_staus_.obstacle_radar_error = 0;
        }

    }
    //导航雷达
    if(usb_robot_status_run_.agv_error.status.position_radar_error == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.PositionRadar_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("导航雷达警报");
        ui.PositionRadar_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.PositionRadar_Cotton->setPalette(color);
        ui.PositionRadar_Cotton->setAlignment(Qt::AlignCenter);

        ui.PositionRadarBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if(alarm_staus_.position_radar_error == 0)
        {
          alarm_staus_.obstacle_radar_error = 13;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.PositionRadar_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.PositionRadar_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.PositionRadar_Cotton->setPalette(color);
        ui.PositionRadar_Cotton->setAlignment(Qt::AlignCenter);

        ui.PositionRadarBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.position_radar_error == 13)
        {
          alarm_staus_.position_radar_error = 0;
        }
    }

    ///////
    //相机状态
    if(usb_robot_status_run_.agv_error.status.scan_radar_error == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.Camera_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("相机状态警报");
        ui.Camera_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Camera_Cotton->setPalette(color);
        ui.Camera_Cotton->setAlignment(Qt::AlignCenter);

        ui.CameraBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));


        if(alarm_staus_.camera_alarm == 0)
        {
          alarm_staus_.camera_alarm = 27;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Camera_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Camera_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Camera_Cotton->setPalette(color);
        ui.Camera_Cotton->setAlignment(Qt::AlignCenter);

        ui.CameraBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

        if(alarm_staus_.camera_alarm == 27)
        {
          alarm_staus_.camera_alarm = 0;
        }
    }

    //交通管制

//    if(traffic != usb_robot_status_run_.agv_error.status.traffic)
//    {
      if(usb_robot_status_run_.agv_error.status.traffic == 1)
      {
          font.setPointSize(WORD_SIZE);
          ui.Traffic_Cotton->setFont(font);
          word_str = QString::fromLocal8Bit("交通管制");
          ui.Traffic_Cotton->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Traffic_Cotton->setPalette(color);
          ui.Traffic_Cotton->setAlignment(Qt::AlignCenter);

          ui.TrafficBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("交通管制");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if( alarm_staus_.traffic_alarm_status == 0)
          {
            alarm_staus_.traffic_alarm_status = 10;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Traffic_Cotton->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Traffic_Cotton->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Traffic_Cotton->setPalette(color);
          ui.Traffic_Cotton->setAlignment(Qt::AlignCenter);

          ui.TrafficBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.traffic_alarm_status = 0;
      }
//    }

    //路径障碍检测
  //    if(nav_obstacle != pc_robot_status_run_.logic.status.nav_obstacle)
  //    {
      if(usb_robot_status_run_.agv_error.status.nav_obstacle == 1)
      {
          font.setPointSize(WORD_SIZE);
          ui.Obstacle_Cotton->setFont(font);
          word_str = QString::fromLocal8Bit("路径障碍检测警报");
          ui.Obstacle_Cotton->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Obstacle_Cotton->setPalette(color);
          ui.Obstacle_Cotton->setAlignment(Qt::AlignCenter);

          ui.ObstacleBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("路径障碍检测警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if( alarm_staus_.nav_obstacle == 0)
          {
            alarm_staus_.nav_obstacle = 17;
            errorLocalLogInfoDecode(word_str);
          }

      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Obstacle_Cotton->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Obstacle_Cotton->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Obstacle_Cotton->setPalette(color);
          ui.Obstacle_Cotton->setAlignment(Qt::AlignCenter);

          ui.ObstacleBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

          if( alarm_staus_.nav_obstacle == 17)
          {
            alarm_staus_.nav_obstacle = 0;
          }

      }
  //    }

    //旋转障碍检测
  //    if(attitude_obstacle != pc_robot_status_run_.logic.status.attitude_obstacle)
  //    {
      if(usb_robot_status_run_.agv_error.status.attitude_obstacle == 1)
      {
          font.setPointSize(WORD_SIZE);
          ui.NavObstacle_Cotton->setFont(font);
          word_str = QString::fromLocal8Bit("旋转障碍检测警报");
          ui.NavObstacle_Cotton->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.NavObstacle_Cotton->setPalette(color);
          ui.NavObstacle_Cotton->setAlignment(Qt::AlignCenter);

          ui.NavObstacleBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("旋转障碍检测警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if( alarm_staus_.attitude_obstacle == 0)
          {
            alarm_staus_.attitude_obstacle = 17;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.NavObstacle_Cotton->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.NavObstacle_Cotton->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.NavObstacle_Cotton->setPalette(color);
          ui.NavObstacle_Cotton->setAlignment(Qt::AlignCenter);

          ui.NavObstacleBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

          if( alarm_staus_.attitude_obstacle == 17)
          {
            alarm_staus_.attitude_obstacle = 0;
          }

      }
  //    }


    //二维码检测
    if(usb_robot_status_run_.agv_error.status.qr_code == 1)
    {
        font.setPointSize(WORD_SIZE);
        ui.Qrcode_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("空抓掉包检测警报");
        ui.Qrcode_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::red);
        ui.Qrcode_Cotton->setPalette(color);
        ui.Qrcode_Cotton->setAlignment(Qt::AlignCenter);

        ui.QrcodeBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

        if( alarm_staus_.Qrcode_alarm_status == 0)
        {
          alarm_staus_.Qrcode_alarm_status = 22;
          errorLocalLogInfoDecode(word_str);
        }
    }
    else
    {
        font.setPointSize(WORD_SIZE);
        ui.Qrcode_Cotton->setFont(font);
        word_str = QString::fromLocal8Bit("无警报");
        ui.Qrcode_Cotton->setText(QString(word_str));                //显示页数
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Qrcode_Cotton->setPalette(color);
        ui.Qrcode_Cotton->setAlignment(Qt::AlignCenter);

        ui.QrcodeBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

        alarm_staus_.Qrcode_alarm_status = 0;
    }

    //网络连接
  //    if(network != pc_robot_status_run_.dev.b.network)
  //    {
//      if(pc_robot_status_run_.dev.b.network == 0)
//      {
//          font.setPointSize(WORD_SIZE);
//          ui.Netconnect_Cotton->setFont(font);
//          word_str = QString::fromLocal8Bit("网络连接警报");
//          ui.Netconnect_Cotton->setText(QString(word_str));                //显示页数
//          color.setColor(QPalette::WindowText,Qt::red);
//          ui.Netconnect_Cotton->setPalette(color);
//          ui.Netconnect_Cotton->setAlignment(Qt::AlignCenter);

//          ui.NetconnectBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

//          QString alarmdata;
//          alarmdata = QString::fromLocal8Bit("网络连接警报!");
//  //          MyDatabaseSql.InsertAlarm(alarmdata);

//          alarm_staus_.floyd_alarm_status = 15;
//      }
//      else
//      {
//          font.setPointSize(WORD_SIZE);
//          ui.Netconnect_Cotton->setFont(font);
//          word_str = QString::fromLocal8Bit("无警报");
//          ui.Netconnect_Cotton->setText(QString(word_str));                //显示页数
//          color.setColor(QPalette::WindowText,Qt::green);
//          ui.Netconnect_Cotton->setPalette(color);
//          ui.Netconnect_Cotton->setAlignment(Qt::AlignCenter);

//          ui.NetconnectBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

//      }
  //    }

    //弗洛伊德规划失败
  //    if(floyd_fail != pc_robot_status_run_.logic.status.floyd_fail)
  //    {
      if(usb_robot_status_run_.agv_error.status.floyd_fail == 1)
      {
          font.setPointSize(WORD_SIZE);
          ui.Floyd_Cotton->setFont(font);
          word_str = QString::fromLocal8Bit("弗洛伊德规划警报");
          ui.Floyd_Cotton->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.Floyd_Cotton->setPalette(color);
          ui.Floyd_Cotton->setAlignment(Qt::AlignCenter);

          ui.FloydBtu_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("弗洛伊德规划警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if( alarm_staus_.floyd_alarm_status == 0)
          {
            alarm_staus_.floyd_alarm_status = 20;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.Floyd_Cotton->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.Floyd_Cotton->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.Floyd_Cotton->setPalette(color);
          ui.Floyd_Cotton->setAlignment(Qt::AlignCenter);

          ui.FloydBtu_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.floyd_alarm_status = 0;
      }
  //    }

    //定位异常
  //    if(local_status != pc_robot_status_run_.logic.status.local_status)
  //    {
      if(usb_robot_status_run_.agv_error.status.local_status == 0)
      {
          font.setPointSize(WORD_SIZE);
          ui.LocalStatus_Cotton->setFont(font);
          word_str = QString::fromLocal8Bit("定位异常警报");
          ui.LocalStatus_Cotton->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::red);
          ui.LocalStatus_Cotton->setPalette(color);
          ui.LocalStatus_Cotton->setAlignment(Qt::AlignCenter);

          ui.LocalStatusBtn_Cotton->setIcon(QIcon(":/image/chache/WarningRed.png"));

          QString alarmdata;
          alarmdata = QString::fromLocal8Bit("定位异常警报!");
  //          MyDatabaseSql.InsertAlarm(alarmdata);

          if( alarm_staus_.local_status == 0)
          {
            alarm_staus_.local_status = 21;
            errorLocalLogInfoDecode(word_str);
          }
      }
      else
      {
          font.setPointSize(WORD_SIZE);
          ui.LocalStatus_Cotton->setFont(font);
          word_str = QString::fromLocal8Bit("无警报");
          ui.LocalStatus_Cotton->setText(QString(word_str));                //显示页数
          color.setColor(QPalette::WindowText,Qt::green);
          ui.LocalStatus_Cotton->setPalette(color);
          ui.LocalStatus_Cotton->setAlignment(Qt::AlignCenter);

          ui.LocalStatusBtn_Cotton->setIcon(QIcon(":/image/chache/Warningblue.png"));

          alarm_staus_.local_status = 0;
      }
  //    }

    //电机错误码`
    //电机错误码
    font.setPointSize(WORD_SIZE);
    ui.Motor_error1_Cotton->setFont(font);
    word_str = QString::number(Motor_re_Run.errorCode, 16);
    ui.Motor_error1_Cotton->setText(QString(word_str));
    color.setColor(QPalette::WindowText,Qt::green);
    ui.Motor_error1_Cotton->setPalette(color);

    font.setPointSize(WORD_SIZE);
    ui.Motor_error2_Cotton->setFont(font);
    word_str = QString::number(Motor_re_Ode.errorCode, 16);
    ui.Motor_error2_Cotton->setText(QString(word_str));
    color.setColor(QPalette::WindowText,Qt::green);
    ui.Motor_error2_Cotton->setPalette(color);

    font.setPointSize(WORD_SIZE);
    ui.Motor_error3_Cotton->setFont(font);
    word_str = QString::number(Motor_re_Hy.errorCode, 16);
    ui.Motor_error3_Cotton->setText(QString(word_str));
    color.setColor(QPalette::WindowText,Qt::green);
    ui.Motor_error3_Cotton->setPalette(color);
  }
}

//传感器状态显示
void MainWindow::ParameterChange()
{
  QPalette color;
  QString word_str;
  QFont font;

  font.setPointSize(WORD_SIZE);

  if(CarTypeStatus == 1)
  {
    //右侧雷达报警
    if(SafeRadarStatus_R < 8 && SafeRadarStatus_R >=0)
    {
      switch(SafeRadarStatus_R)
      {
        case 0: word_str = QString::fromLocal8Bit("区域1、2、3"); break;
        case 1: word_str = QString::fromLocal8Bit("区域2、3"); break;
        case 2: word_str = QString::fromLocal8Bit("区域1、3"); break;
        case 3: word_str = QString::fromLocal8Bit("区域3"); break;
        case 4: word_str = QString::fromLocal8Bit("区域1、2"); break;
        case 5: word_str = QString::fromLocal8Bit("区域2"); break;
        case 6: word_str = QString::fromLocal8Bit("区域1"); break;
        case 7: word_str = QString::fromLocal8Bit("区域无障碍"); break;
        default: break;
      }

      ui.RadarRight_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.RadarRight_Cotton->setScaledContents(true);

      ui.RadarRight_2_Cotton->setFont(font);
      ui.RadarRight_2_Cotton->setText(QString(word_str));                //显示页数
      ui.RadarRight_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RadarRight_2_Cotton->setPalette(color);

      ui.SafrtyRadarControl_R_Cotton_La->setFont(font);
      ui.SafrtyRadarControl_R_Cotton_La->setText(QString(word_str));                //显示页数
      ui.SafrtyRadarControl_R_Cotton_La->setAlignment(Qt::AlignLeft);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafrtyRadarControl_R_Cotton_La->setPalette(color);
    }

//左侧雷达
//    SafeRadarStatus_L = 1;
    if(SafeRadarStatus_L < 8 && SafeRadarStatus_L >=0)
    {
      switch(SafeRadarStatus_L)
      {
        case 0: word_str = QString::fromLocal8Bit("区域1、2、3"); break;
        case 1: word_str = QString::fromLocal8Bit("区域2、3"); break;
        case 2: word_str = QString::fromLocal8Bit("区域1、3"); break;
        case 3: word_str = QString::fromLocal8Bit("区域3"); break;
        case 4: word_str = QString::fromLocal8Bit("区域1、2"); break;
        case 5: word_str = QString::fromLocal8Bit("区域2"); break;
        case 6: word_str = QString::fromLocal8Bit("区域1"); break;
        case 7: word_str = QString::fromLocal8Bit("区域无障碍"); break;
        default: break;
      }

      ui.RadarLeft_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.RadarLeft_Cotton->setScaledContents(true);

      ui.RadarLeft_2_Cotton->setFont(font);
      ui.RadarLeft_2_Cotton->setText(QString(word_str));                //显示页数
      ui.RadarLeft_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RadarLeft_2_Cotton->setPalette(color);

      ui.SafrtyRadarControl_L_Cotton_La->setFont(font);
      ui.SafrtyRadarControl_L_Cotton_La->setText(QString(word_str));                //显示页数
      ui.SafrtyRadarControl_L_Cotton_La->setAlignment(Qt::AlignLeft);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafrtyRadarControl_L_Cotton_La->setPalette(color);
    }

    //急停
    if(rtu317.in.ch.bit0_emergency1 == 1 || rtu317.in.ch.bit1_emergency2 == 1)
    {
      ui.Stop->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Stop->setScaledContents(true);

      ui.Stop_2->setFont(font);
      word_str = QString::fromLocal8Bit("急停拍下");
      ui.Stop_2->setText(QString(word_str));                //显示页数
      ui.Stop_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Stop_2->setPalette(color);
    }
    else
    {
      ui.Stop->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Stop->setScaledContents(true);

      ui.Stop_2->setFont(font);
      word_str = QString::fromLocal8Bit("急停松开");
      ui.Stop_2->setText(QString(word_str));                //显示页数
      ui.Stop_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Stop_2->setPalette(color);
    }

    //防撞条
    if(rtu317.in.ch.bit12_impact== 1)
    {
      ui.Impactpara->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Impactpara->setScaledContents(true);

      ui.Impactpara_2->setFont(font);
      word_str = QString::fromLocal8Bit("防撞报警");
      ui.Impactpara_2->setText(QString(word_str));                //显示页数
      ui.Impactpara_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Impactpara_2->setPalette(color);
    }
    else
    {
      ui.Impactpara->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Impactpara->setScaledContents(true);

      ui.Impactpara_2->setFont(font);
      word_str = QString::fromLocal8Bit("未报警");
      ui.Impactpara_2->setText(QString(word_str));                //显示页数
      ui.Impactpara_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Impactpara_2->setPalette(color);
    }

    //棉包夹下限位
    if(rtu317f_clean.in.ch.bit5_sgnFanStatus1 == 1)
    {
      ui.Inlimit_2->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Inlimit_2->setScaledContents(true);

      ui.Inlimit->setFont(font);
      word_str = QString::fromLocal8Bit("已开启");
      ui.Inlimit->setText(QString(word_str));                //显示页数
      ui.Inlimit->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Inlimit->setPalette(color);
    }
    else
    {
      ui.Inlimit_2->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Inlimit_2->setScaledContents(true);

      ui.Inlimit->setFont(font);
      word_str = QString::fromLocal8Bit("未开启");
      ui.Inlimit->setText(QString(word_str));                //显示页数
      ui.Inlimit->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Inlimit->setPalette(color);
    }

    //棉包夹上限位
    if(rtu317f_clean.in.ch.bit6_sgnFanStatus2 == 1)
    {
      ui.InArrive_2->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.InArrive_2->setScaledContents(true);

      ui.InArrive->setFont(font);
      word_str = QString::fromLocal8Bit("已开启");
      ui.InArrive->setText(QString(word_str));                //显示页数
      ui.InArrive->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.InArrive->setPalette(color);
    }
    else
    {
      ui.InArrive_2->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.InArrive_2->setScaledContents(true);

      ui.InArrive->setFont(font);
      word_str = QString::fromLocal8Bit("未开启");
      ui.InArrive->setText(QString(word_str));                //显示页数
      ui.InArrive->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.InArrive->setPalette(color);
    }

    //棉包夹抬升限位
    if(rtu317.in.ch.bit2_swOpenLimit == 1)
    {
      ui.OutLimmit_2->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.OutLimmit_2->setScaledContents(true);

      ui.OutLimmit->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.OutLimmit->setText(QString(word_str));                //显示页数
      ui.OutLimmit->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.OutLimmit->setPalette(color);
    }
    else
    {
      ui.OutLimmit_2->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.OutLimmit_2->setScaledContents(true);

      ui.OutLimmit->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.OutLimmit->setText(QString(word_str));                //显示页数
      ui.OutLimmit->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.OutLimmit->setPalette(color);
    }

    //棉包夹滑落检测
    if(rtu317.in.ch.bit4_swOpen == 1)
    {
      ui.OutArrive_2->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.OutArrive_2->setScaledContents(true);

      ui.OutArrive->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.OutArrive->setText(QString(word_str));                //显示页数
      ui.OutArrive->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.OutArrive->setPalette(color);
    }
    else
    {
      ui.OutArrive_2->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.OutArrive_2->setScaledContents(true);

      ui.OutArrive->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.OutArrive->setText(QString(word_str));                //显示页数
      ui.OutArrive->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.OutArrive->setPalette(color);
    }

    //棉包左夹开限位
    if(rtu317.in.ch.bit6_swTouch == 1)
    {
      ui.Touch_2->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Touch_2->setScaledContents(true);

      ui.Touch->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Touch->setText(QString(word_str));                //显示页数
      ui.Touch->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch->setPalette(color);
    }
    else
    {
      ui.Touch_2->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Touch_2->setScaledContents(true);

      ui.Touch->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Touch->setText(QString(word_str));                //显示页数
      ui.Touch->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch->setPalette(color);
    }

  //    //棉包左夹关限位
  //    if(rtu317.ch.bit8_swPawSafe1 == 1)
  //    {
  //      ui.PawSafe1_2->setPixmap(QPixmap(":/image/chache/longred.png"));
  //      ui.PawSafe1_2->setScaledContents(true);

  //      ui.PawSafe1->setFont(font);
  //      word_str = QString::fromLocal8Bit("已触发");
  //      ui.PawSafe1->setText(QString(word_str));                //显示页数
  //      ui.PawSafe1->setAlignment(Qt::AlignCenter);
  //      color.setColor(QPalette::WindowText,Qt::white);
  //      ui.PawSafe1->setPalette(color);
  //    }
  //    else
  //    {
  //      ui.PawSafe1_2->setPixmap(QPixmap(":/image/chache/longgreen.png"));
  //      ui.PawSafe1_2->setScaledContents(true);

  //      ui.PawSafe1->setFont(font);
  //      word_str = QString::fromLocal8Bit("未触发");
  //      ui.PawSafe1->setText(QString(word_str));                //显示页数
  //      ui.PawSafe1->setAlignment(Qt::AlignCenter);
  //      color.setColor(QPalette::WindowText,Qt::white);
  //      ui.PawSafe1->setPalette(color);
  //    }

  //    //光电开关11
  //    if(rtu317.ch.bit9_swPawSafe2 == 1)
  //    {
  //      ui.PawSafe2_2->setPixmap(QPixmap(":/image/chache/longred.png"));
  //      ui.PawSafe2_2->setScaledContents(true);

  //      ui.PawSafe2->setFont(font);
  //      word_str = QString::fromLocal8Bit("已触发");
  //      ui.PawSafe2->setText(QString(word_str));                //显示页数
  //      ui.PawSafe2->setAlignment(Qt::AlignCenter);
  //      color.setColor(QPalette::WindowText,Qt::white);
  //      ui.PawSafe2->setPalette(color);
  //    }
  //    else
  //    {
  //      ui.PawSafe2_2->setPixmap(QPixmap(":/image/chache/longgreen.png"));
  //      ui.PawSafe2_2->setScaledContents(true);

  //      ui.PawSafe2->setFont(font);
  //      word_str = QString::fromLocal8Bit("未触发");
  //      ui.PawSafe2->setText(QString(word_str));                //显示页数
  //      ui.PawSafe2->setAlignment(Qt::AlignCenter);
  //      color.setColor(QPalette::WindowText,Qt::white);
  //      ui.PawSafe2->setPalette(color);
  //    }

    //光电开关12
    if(rtu317f_clean.in.ch.bit7_sgnFanStatus3 == 1)
    {
      ui.Door1_2->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Door1_2->setScaledContents(true);

      ui.Door1->setFont(font);
      word_str = QString::fromLocal8Bit("已开启");
      ui.Door1->setText(QString(word_str));                //显示页数
      ui.Door1->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Door1->setPalette(color);
    }
    else
    {
      ui.Door1_2->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Door1_2->setScaledContents(true);

      ui.Door1->setFont(font);
      word_str = QString::fromLocal8Bit("未开启");
      ui.Door1->setText(QString(word_str));                //显示页数
      ui.Door1->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Door1->setPalette(color);
    }

  //    //光电开关21
  //    if(rtu317.in.ch.bit15_manualClose == 1)
  //    {
  //      ui.Door2_2->setPixmap(QPixmap(":/image/chache/longred.png"));
  //      ui.Door2_2->setScaledContents(true);

  //      ui.Door2->setFont(font);
  //      word_str = QString::fromLocal8Bit("已触发");
  //      ui.Door2->setText(QString(word_str));                //显示页数
  //      ui.Door2->setAlignment(Qt::AlignCenter);
  //      color.setColor(QPalette::WindowText,Qt::white);
  //      ui.Door2->setPalette(color);
  //    }
  //    else
  //    {
  //      ui.Door2_2->setPixmap(QPixmap(":/image/chache/longgreen.png"));
  //      ui.Door2_2->setScaledContents(true);

  //      ui.Door2->setFont(font);
  //      word_str = QString::fromLocal8Bit("未启用");
  //      ui.Door2->setText(QString(word_str));                //显示页数
  //      ui.Door2->setAlignment(Qt::AlignCenter);
  //      color.setColor(QPalette::WindowText,Qt::white);
  //      ui.Door2->setPalette(color);
  //    }

    //光电开关22
    if(rtu317.in.ch.bit7_swDrop == 1)
    {
      ui.Drop_2->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Drop_2->setScaledContents(true);

      ui.Drop->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Drop->setText(QString(word_str));                //显示页数
      ui.Drop->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Drop->setPalette(color);
    }
    else
    {
      ui.Drop_2->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Drop_2->setScaledContents(true);

      ui.Drop->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Drop->setText(QString(word_str));                //显示页数
      ui.Drop->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Drop->setPalette(color);
    }
  }
  else if(CarTypeStatus == 2)
  {
    //急停
    if(rtu317_CX.in.ch.bit0_emergency1 == 1 || rtu317_CX.in.ch.bit1_emergency2 == 1)
    {
      ui.Stop_Ma->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Stop_Ma->setScaledContents(true);

      ui.Stop_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("急停拍下");
      ui.Stop_Ma_2->setText(QString(word_str));                //显示页数
      ui.Stop_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Stop_Ma_2->setPalette(color);
    }
    else
    {
      ui.Stop_Ma->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Stop_Ma->setScaledContents(true);

      ui.Stop_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("急停松开");
      ui.Stop_Ma_2->setText(QString(word_str));                //显示页数
      ui.Stop_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Stop_Ma_2->setPalette(color);
    }

    //防撞条
    if(rtu317_CX.in.ch.bit3_impact== 1)
    {
      ui.Impactpara_Ma->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Impactpara_Ma->setScaledContents(true);

      ui.Impactpara_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("防撞报警");
      ui.Impactpara_Ma_2->setText(QString(word_str));                //显示页数
      ui.Impactpara_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Impactpara_Ma_2->setPalette(color);
    }
    else
    {
      ui.Impactpara_Ma->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Impactpara_Ma->setScaledContents(true);

      ui.Impactpara_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("未报警");
      ui.Impactpara_Ma_2->setText(QString(word_str));                //显示页数
      ui.Impactpara_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Impactpara_Ma_2->setPalette(color);
    }

    //防撞条
    if(ultr_data2 != 0)
    {
      ui.Ultrasonic_Ma->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Ultrasonic_Ma->setScaledContents(true);

      QString num;

      num = QString::number(ultr_data2, 10);
      ui.Ultrasonic_Ma_2->setText(num);
      ui.Ultrasonic_Ma_2->setFont(font);
    }
    else
    {
      ui.Ultrasonic_Ma->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Ultrasonic_Ma->setScaledContents(true);

      ui.Ultrasonic_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("未启用");
      ui.Ultrasonic_Ma_2->setText(QString(word_str));                //显示页数
      ui.Ultrasonic_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Ultrasonic_Ma_2->setPalette(color);
    }


    //钥匙开关信号
    if(rtu317_CX.in.ch.bit7_reboot == 1)
    {
      ui.DelayShutDown_Ma->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.DelayShutDown_Ma->setScaledContents(true);

      ui.DelayShutDown_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.DelayShutDown_Ma_2->setText(QString(word_str));                //显示页数
      ui.DelayShutDown_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.DelayShutDown_Ma_2->setPalette(color);
    }
    else
    {
      ui.DelayShutDown_Ma->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.DelayShutDown_Ma->setScaledContents(true);

      ui.DelayShutDown_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("未启用");
      ui.DelayShutDown_Ma_2->setText(QString(word_str));                //显示页数
      ui.DelayShutDown_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.DelayShutDown_Ma_2->setPalette(color);
    }

    //磁吸运行信号 机器人磁吸打开
    if(rtu317_CX.in.ch.bit2_swCXPower == 1)
    {
      ui.CXPower_Ma->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.CXPower_Ma->setScaledContents(true);

      ui.CXPower_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.CXPower_Ma_2->setText(QString(word_str));                //显示页数
      ui.CXPower_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.CXPower_Ma_2->setPalette(color);
    }
    else
    {
      ui.CXPower_Ma->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.CXPower_Ma->setScaledContents(true);

      ui.CXPower_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("未启用");
      ui.CXPower_Ma_2->setText(QString(word_str));                //显示页数
      ui.CXPower_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.CXPower_Ma_2->setPalette(color);
    }

    //方桶到位检测left
    if(rtu317_CX.in.ch.bit5_swTubeL == 1)
    {
      ui.TubeL_Ma->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.TubeL_Ma->setScaledContents(true);

      ui.TubeL_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.TubeL_Ma_2->setText(QString(word_str));                //显示页数
      ui.TubeL_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.TubeL_Ma_2->setPalette(color);
    }
    else
    {
      ui.TubeL_Ma->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.TubeL_Ma->setScaledContents(true);

      ui.TubeL_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("未启用");
      ui.TubeL_Ma_2->setText(QString(word_str));                //显示页数
      ui.TubeL_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.TubeL_Ma_2->setPalette(color);
    }

    //方桶到位检测right
    if(rtu317_CX.in.ch.bit5_swTubeL == 1)
    {
      ui.TubeR_Ma->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.TubeR_Ma->setScaledContents(true);

      ui.TubeR_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.TubeR_Ma_2->setText(QString(word_str));                //显示页数
      ui.TubeR_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.TubeR_Ma_2->setPalette(color);
    }
    else
    {
      ui.TubeR_Ma->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.TubeR_Ma->setScaledContents(true);

      ui.TubeR_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("未启用");
      ui.TubeR_Ma_2->setText(QString(word_str));                //显示页数
      ui.TubeR_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.TubeR_Ma_2->setPalette(color);
    }

    //方桶有无检测信号 drop
    if(rtu317_CX.in.ch.bit4_swCkTube == 1)
    {
      ui.Drop_Ma->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Drop_Ma->setScaledContents(true);

      ui.Drop_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Drop_Ma_2->setText(QString(word_str));                //显示页数
      ui.Drop_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Drop_Ma_2->setPalette(color);
    }
    else
    {
      ui.Drop_Ma->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Drop_Ma->setScaledContents(true);

      ui.Drop_Ma_2->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Drop_Ma_2->setText(QString(word_str));                //显示页数
      ui.Drop_Ma_2->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Drop_Ma_2->setPalette(color);
    }
  }
  else if(CarTypeStatus == 3)
  {
    //电推杆上电信号
    if(rtu317e.in.ch.bit11_sgnHookSW== 1)
    {
      ui.SafetyRadar4_20_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_20_Semi->setScaledContents(true);

      ui.SafetyRadar4_19_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("电推杆上电");
      ui.SafetyRadar4_19_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_19_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_19_Semi->setPalette(color);
    }
    else
    {
      ui.SafetyRadar4_20_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.SafetyRadar4_20_Semi->setScaledContents(true);

      ui.SafetyRadar4_19_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("电推杆未上电");
      ui.SafetyRadar4_19_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_19_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_19_Semi->setPalette(color);
    }

    //急停
    if(rtu3170.in.ch.bit0_emergentStop1 == 1 || rtu3170.in.ch.bit1_emergentStop2 == 1 || rtu3170.in.ch.bit2_emergentStop3 == 1)
    {
      ui.Stop_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Stop_Semi->setScaledContents(true);

      ui.Stop_2_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("急停拍下");
      ui.Stop_2_Semi->setText(QString(word_str));                //显示页数
      ui.Stop_2_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Stop_2_Semi->setPalette(color);
    }
    else
    {
      ui.Stop_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Stop_Semi->setScaledContents(true);

      ui.Stop_2_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("急停松开");
      ui.Stop_2_Semi->setText(QString(word_str));                //显示页数
      ui.Stop_2_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Stop_2_Semi->setPalette(color);
    }

    //防撞条
    if(rtu3170.in.ch.bit5_impact== 1)
    {
      ui.Impactpara_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Impactpara_Semi->setScaledContents(true);

      ui.Impactpara_2_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("防撞报警");
      ui.Impactpara_2_Semi->setText(QString(word_str));                //显示页数
      ui.Impactpara_2_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Impactpara_2_Semi->setPalette(color);
    }
    else
    {
      ui.Impactpara_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Impactpara_Semi->setScaledContents(true);

      ui.Impactpara_2_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未报警");
      ui.Impactpara_2_Semi->setText(QString(word_str));                //显示页数
      ui.Impactpara_2_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Impactpara_2_Semi->setPalette(color);
    }

    //工人确认按键
    if(rtu3170.in.ch.bit3_workerEnter == 1)
    {
      ui.Inlimit_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Inlimit_2_Semi->setScaledContents(true);

      ui.Inlimit_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Inlimit_Semi->setText(QString(word_str));                //显示页数
      ui.Inlimit_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Inlimit_Semi->setPalette(color);
    }
    else
    {
      ui.Inlimit_2_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Inlimit_2_Semi->setScaledContents(true);

      ui.Inlimit_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Inlimit_Semi->setText(QString(word_str));                //显示页数
      ui.Inlimit_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Inlimit_Semi->setPalette(color);
    }

    //钥匙开关
    if(rtu3170.in.ch.bit4_powerKey == 1)
    {
      ui.OutLimmit_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.OutLimmit_2_Semi->setScaledContents(true);

      ui.OutLimmit_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.OutLimmit_Semi->setText(QString(word_str));                //显示页数
      ui.OutLimmit_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.OutLimmit_Semi->setPalette(color);
    }
    else
    {
      ui.OutLimmit_2_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.OutLimmit_2_Semi->setScaledContents(true);

      ui.OutLimmit_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.OutLimmit_Semi->setText(QString(word_str));                //显示页数
      ui.OutLimmit_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.OutLimmit_Semi->setPalette(color);
    }

    //抬升上限位
    if(rtu3170.in.ch.bit6_sgnUpLimit == 1)
    {
      ui.OutArrive_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.OutArrive_2_Semi->setScaledContents(true);

      ui.OutArrive_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.OutArrive_Semi->setText(QString(word_str));                //显示页数
      ui.OutArrive_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.OutArrive_Semi->setPalette(color);
    }
    else
    {
      ui.OutArrive_2_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.OutArrive_2_Semi->setScaledContents(true);

      ui.OutArrive_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.OutArrive_Semi->setText(QString(word_str));                //显示页数
      ui.OutArrive_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.OutArrive_Semi->setPalette(color);
    }

    //抬升下限位
    if(rtu3170.in.ch.bit7_sgnDownLimit == 1)
    {
      ui.Touch_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Touch_2_Semi->setScaledContents(true);

      ui.Touch_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Touch_Semi->setText(QString(word_str));                //显示页数
      ui.Touch_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch_Semi->setPalette(color);
    }
    else
    {
      ui.Touch_2_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Touch_2_Semi->setScaledContents(true);

      ui.Touch_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Touch_Semi->setText(QString(word_str));                //显示页数
      ui.Touch_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch_Semi->setPalette(color);
    }

//    if(rtu3170.in.ch.bit6_left_completed == 1 || rtu3170.in.ch.bit7_right_completed == 1)
//    {
//      SureCancelStatus = 1;
//    }

    //左前是否有筒
    if(rtu3170.in.ch.bit8_bucketLF == 1)
    {
      ui.Touch_4_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Touch_4_Semi->setScaledContents(true);

      ui.Touch_3_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Touch_3_Semi->setText(QString(word_str));                //显示页数
      ui.Touch_3_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch_3_Semi->setPalette(color);
    }
    else
    {
      ui.Touch_4_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Touch_4_Semi->setScaledContents(true);

      ui.Touch_3_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Touch_3_Semi->setText(QString(word_str));                //显示页数
      ui.Touch_3_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch_3_Semi->setPalette(color);
    }

    //左后是否有筒
    if(rtu3170.in.ch.bit9_bucketLB == 1)
    {
      ui.Touch_6_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Touch_6_Semi->setScaledContents(true);

      ui.Touch_5_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Touch_5_Semi->setText(QString(word_str));                //显示页数
      ui.Touch_5_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch_5_Semi->setPalette(color);
    }
    else
    {
      ui.Touch_6_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Touch_6_Semi->setScaledContents(true);

      ui.Touch_5_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Touch_5_Semi->setText(QString(word_str));                //显示页数
      ui.Touch_5_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch_5_Semi->setPalette(color);
    }

    //右前是否有筒
    if(rtu3170.in.ch.bit10_bucketRF == 1)
    {
      ui.Touch_8_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Touch_8_Semi->setScaledContents(true);

      ui.Touch_7_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Touch_7_Semi->setText(QString(word_str));                //显示页数
      ui.Touch_7_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch_7_Semi->setPalette(color);
    }
    else
    {
      ui.Touch_8_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Touch_8_Semi->setScaledContents(true);

      ui.Touch_7_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Touch_7_Semi->setText(QString(word_str));                //显示页数
      ui.Touch_7_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch_7_Semi->setPalette(color);
    }

    //右后是否有筒
    if(rtu3170.in.ch.bit11_bucketRB == 1)
    {
      ui.Touch_10_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Touch_10_Semi->setScaledContents(true);

      ui.Touch_9_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Touch_9_Semi->setText(QString(word_str));                //显示页数
      ui.Touch_9_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch_9_Semi->setPalette(color);
    }
    else
    {
      ui.Touch_10_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Touch_10_Semi->setScaledContents(true);

      ui.Touch_9_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Touch_9_Semi->setText(QString(word_str));                //显示页数
      ui.Touch_9_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Touch_9_Semi->setPalette(color);
    }

    //LED灯上电信号
    if(rtu317e.in.ch.bit15_sgnLedSW == 1)
    {
      ui.SafetyRadar4_18_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_18_Semi->setScaledContents(true);

      ui.SafetyRadar4_17_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.SafetyRadar4_17_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_17_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_17_Semi->setPalette(color);
    }
    else
    {
      ui.SafetyRadar4_18_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.SafetyRadar4_18_Semi->setScaledContents(true);

      ui.SafetyRadar4_17_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.SafetyRadar4_17_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_17_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_17_Semi->setPalette(color);
    }

    //工人确认按键
    if(rtu3170.in.ch.bit3_workerEnter == 1)
    {
      ui.Inlimit_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Inlimit_2_Semi->setScaledContents(true);

      ui.Inlimit_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Inlimit_Semi->setText(QString(word_str));                //显示页数
      ui.Inlimit_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Inlimit_Semi->setPalette(color);
    }
    else
    {
      ui.Inlimit_2_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Inlimit_2_Semi->setScaledContents(true);

      ui.Inlimit_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Inlimit_Semi->setText(QString(word_str));                //显示页数
      ui.Inlimit_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Inlimit_Semi->setPalette(color);
    }

    //安全雷达1-1
    safety_radar1.bit.bit0_safetyradar = rtu317e.in.ch.bit8_radarO11;
    safety_radar1.bit.bit1_safetyradar = rtu317e.in.ch.bit9_radarO12;
    safety_radar1.bit.bit2_safetyradar = rtu317e.in.ch.bit10_radarO13;

    if(safety_radar1.data == 0x00)
    {
      ui.SafetyRadar1_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar1_2_Semi->setScaledContents(true);

      ui.SafetyRadar1_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域1/2/3");
      ui.SafetyRadar1_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar1_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar1_1_Semi->setPalette(color);
    }
    else if(safety_radar1.data == 0x01)
    {
      ui.SafetyRadar1_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar1_2_Semi->setScaledContents(true);

      ui.SafetyRadar1_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域2/3");
      ui.SafetyRadar1_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar1_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar1_1_Semi->setPalette(color);
    }
    else if(safety_radar1.data == 0x02)
    {
      ui.SafetyRadar1_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar1_2_Semi->setScaledContents(true);

      ui.SafetyRadar1_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域1/3");
      ui.SafetyRadar1_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar1_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar1_1_Semi->setPalette(color);
    }
    else if(safety_radar1.data == 0x03)
    {
      ui.SafetyRadar1_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar1_2_Semi->setScaledContents(true);

      ui.SafetyRadar1_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域3");
      ui.SafetyRadar1_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar1_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar1_1_Semi->setPalette(color);
    }
    else if(safety_radar1.data == 0x04)
    {
      ui.SafetyRadar1_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar1_2_Semi->setScaledContents(true);

      ui.SafetyRadar1_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域1/2");
      ui.SafetyRadar1_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar1_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar1_1_Semi->setPalette(color);
    }
    else if(safety_radar1.data == 0x05)
    {
      ui.SafetyRadar1_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar1_2_Semi->setScaledContents(true);

      ui.SafetyRadar1_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域2");
      ui.SafetyRadar1_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar1_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar1_1_Semi->setPalette(color);
    }
    else if(safety_radar1.data == 0x06)
    {
      ui.SafetyRadar1_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar1_2_Semi->setScaledContents(true);

      ui.SafetyRadar1_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域1");
      ui.SafetyRadar1_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar1_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar1_1_Semi->setPalette(color);
    }
    else if(safety_radar1.data == 0x07)
    {
      ui.SafetyRadar1_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar1_2_Semi->setScaledContents(true);

      ui.SafetyRadar1_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域无障碍");
      ui.SafetyRadar1_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar1_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar1_1_Semi->setPalette(color);
    }

    //安全雷达2-1
    safety_radar2.bit.bit0_safetyradar = rtu317e.in.ch.bit12_radarO21;
    safety_radar2.bit.bit1_safetyradar = rtu317e.in.ch.bit13_radarO22;
    safety_radar2.bit.bit2_safetyradar = rtu317e.in.ch.bit14_radarO23;
    if(safety_radar2.data == 0x00)
    {
      ui.SafetyRadar4_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_2_Semi->setScaledContents(true);

      ui.SafetyRadar4_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域1/2/3");
      ui.SafetyRadar4_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_1_Semi->setPalette(color);
    }
    else if(safety_radar2.data == 0x01)
    {
      ui.SafetyRadar4_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_2_Semi->setScaledContents(true);

      ui.SafetyRadar4_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域2/3");
      ui.SafetyRadar4_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_1_Semi->setPalette(color);
    }
    else if(safety_radar2.data == 0x02)
    {
      ui.SafetyRadar4_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_2_Semi->setScaledContents(true);

      ui.SafetyRadar4_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域1/3");
      ui.SafetyRadar4_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_1_Semi->setPalette(color);
    }
    else if(safety_radar2.data == 0x03)
    {
      ui.SafetyRadar4_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_2_Semi->setScaledContents(true);

      ui.SafetyRadar4_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域3");
      ui.SafetyRadar4_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_1_Semi->setPalette(color);
    }
    else if(safety_radar2.data == 0x04)
    {
      ui.SafetyRadar4_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_2_Semi->setScaledContents(true);

      ui.SafetyRadar4_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域1/2");
      ui.SafetyRadar4_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_1_Semi->setPalette(color);
    }
    else if(safety_radar2.data == 0x05)
    {
      ui.SafetyRadar4_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_2_Semi->setScaledContents(true);

      ui.SafetyRadar4_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域2");
      ui.SafetyRadar4_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_1_Semi->setPalette(color);
    }
    else if(safety_radar2.data == 0x06)
    {
      ui.SafetyRadar4_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_2_Semi->setScaledContents(true);

      ui.SafetyRadar4_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域1");
      ui.SafetyRadar4_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_1_Semi->setPalette(color);
    }
    else if(safety_radar2.data == 0x07)
    {
      ui.SafetyRadar4_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_2_Semi->setScaledContents(true);

      ui.SafetyRadar4_1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("区域无障碍");
      ui.SafetyRadar4_1_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_1_Semi->setPalette(color);
    }

    //左前推筒限位
    if(rtu3170.in.ch.bit12_sgnPushLimitLF == 1)
    {
      ui.SafetyRadar4_8_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_8_Semi->setScaledContents(true);

      ui.SafetyRadar4_7_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.SafetyRadar4_7_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_7_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_7_Semi->setPalette(color);
    }
    else
    {
      ui.SafetyRadar4_8_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.SafetyRadar4_8_Semi->setScaledContents(true);

      ui.SafetyRadar4_7_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.SafetyRadar4_7_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_7_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_7_Semi->setPalette(color);
    }

    //左后推筒限位
    if(rtu3170.in.ch.bit13_sgnPushLimitLB == 1)
    {
      ui.SafetyRadar4_21_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_21_Semi->setScaledContents(true);

      ui.SafetyRadar4_22_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.SafetyRadar4_22_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_22_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_22_Semi->setPalette(color);
    }
    else
    {
      ui.SafetyRadar4_21_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.SafetyRadar4_21_Semi->setScaledContents(true);

      ui.SafetyRadar4_22_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.SafetyRadar4_22_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_22_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_22_Semi->setPalette(color);
    }

    //右前推筒限位
    if(rtu3170.in.ch.bit14_sgnPushLimitRF == 1)
    {
      ui.PawSafe1_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.PawSafe1_2_Semi->setScaledContents(true);

      ui.PawSafe1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.PawSafe1_Semi->setText(QString(word_str));                //显示页数
      ui.PawSafe1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.PawSafe1_Semi->setPalette(color);
    }
    else
    {
      ui.PawSafe1_2_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.PawSafe1_2_Semi->setScaledContents(true);

      ui.PawSafe1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.PawSafe1_Semi->setText(QString(word_str));                //显示页数
      ui.PawSafe1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.PawSafe1_Semi->setPalette(color);
    }

    //右后推筒限位
    if(rtu3170.in.ch.bit15_sgnPushLimitRB == 1)
    {
      ui.PawSafe2_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.PawSafe2_2_Semi->setScaledContents(true);

      ui.PawSafe2_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.PawSafe2_Semi->setText(QString(word_str));                //显示页数
      ui.PawSafe2_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.PawSafe2_Semi->setPalette(color);
    }
    else
    {
      ui.PawSafe2_2_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.PawSafe2_2_Semi->setScaledContents(true);

      ui.PawSafe2_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.PawSafe2_Semi->setText(QString(word_str));                //显示页数
      ui.PawSafe2_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.PawSafe2_Semi->setPalette(color);
    }

    //左挡板上限位
    if(rtu317e.in.ch.bit0_sgnStepLU == 1)
    {
      ui.Door1_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Door1_2_Semi->setScaledContents(true);

      ui.Door1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Door1_Semi->setText(QString(word_str));                //显示页数
      ui.Door1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Door1_Semi->setPalette(color);
    }
    else
    {
      ui.Door1_2_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Door1_2_Semi->setScaledContents(true);

      ui.Door1_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Door1_Semi->setText(QString(word_str));                //显示页数
      ui.Door1_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Door1_Semi->setPalette(color);
    }

    //左挡板下限位
    if(rtu317e.in.ch.bit1_sgnStepLD == 1)
    {
      ui.Door2_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Door2_2_Semi->setScaledContents(true);

      ui.Door2_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Door2_Semi->setText(QString(word_str));                //显示页数
      ui.Door2_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Door2_Semi->setPalette(color);
    }
    else
    {
      ui.Door2_2_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Door2_2_Semi->setScaledContents(true);

      ui.Door2_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Door2_Semi->setText(QString(word_str));                //显示页数
      ui.Door2_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Door2_Semi->setPalette(color);
    }

    //右挡板上限位
    if(rtu317e.in.ch.bit2_sgnStepRU == 1)
    {
      ui.Drop_2_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Drop_2_Semi->setScaledContents(true);

      ui.Drop_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Drop_Semi->setText(QString(word_str));                //显示页数
      ui.Drop_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Drop_Semi->setPalette(color);
    }
    else
    {
      ui.Drop_2_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Drop_2_Semi->setScaledContents(true);

      ui.Drop_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Drop_Semi->setText(QString(word_str));                //显示页数
      ui.Drop_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Drop_Semi->setPalette(color);
    }

    //右挡板下限位
    if(rtu317e.in.ch.bit3_sgnStepRD == 1)
    {
      ui.Drop_3_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Drop_3_Semi->setScaledContents(true);

      ui.Drop_4_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Drop_4_Semi->setText(QString(word_str));                //显示页数
      ui.Drop_4_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Drop_4_Semi->setPalette(color);
    }
    else
    {
      ui.Drop_3_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Drop_3_Semi->setScaledContents(true);

      ui.Drop_4_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Drop_4_Semi->setText(QString(word_str));                //显示页数
      ui.Drop_4_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Drop_4_Semi->setPalette(color);
    }

    //左勾筒上限位
    if(rtu317e.in.ch.bit4_sgnHookLF == 1)
    {
      ui.SafetyRadar4_10_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_10_Semi->setScaledContents(true);

      ui.SafetyRadar4_9_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.SafetyRadar4_9_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_9_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_9_Semi->setPalette(color);
    }
    else
    {
      ui.SafetyRadar4_10_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.SafetyRadar4_10_Semi->setScaledContents(true);

      ui.SafetyRadar4_9_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.SafetyRadar4_9_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_9_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_9_Semi->setPalette(color);
    }

    //左勾筒下限位
    if(rtu317e.in.ch.bit5_sgnHookLB == 1)
    {
      ui.SafetyRadar4_12_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_12_Semi->setScaledContents(true);

      ui.SafetyRadar4_11_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.SafetyRadar4_11_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_11_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_11_Semi->setPalette(color);
    }
    else
    {
      ui.SafetyRadar4_12_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.SafetyRadar4_12_Semi->setScaledContents(true);

      ui.SafetyRadar4_11_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.SafetyRadar4_11_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_11_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_11_Semi->setPalette(color);
    }

    //右勾筒上限位
    if(rtu317e.in.ch.bit6_sgnHookRF == 1)
    {
      ui.SafetyRadar4_14_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_14_Semi->setScaledContents(true);

      ui.SafetyRadar4_13_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.SafetyRadar4_13_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_13_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_13_Semi->setPalette(color);
    }
    else
    {
      ui.SafetyRadar4_14_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.SafetyRadar4_14_Semi->setScaledContents(true);

      ui.SafetyRadar4_13_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.SafetyRadar4_13_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_13_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_13_Semi->setPalette(color);
    }

    //右勾筒下限位
    if(rtu317e.in.ch.bit7_sgnHookRB == 1)
    {
      ui.SafetyRadar4_16_Semi->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.SafetyRadar4_16_Semi->setScaledContents(true);

      ui.SafetyRadar4_15_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.SafetyRadar4_15_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_15_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_15_Semi->setPalette(color);
    }
    else
    {
      ui.SafetyRadar4_16_Semi->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.SafetyRadar4_16_Semi->setScaledContents(true);

      ui.SafetyRadar4_15_Semi->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.SafetyRadar4_15_Semi->setText(QString(word_str));                //显示页数
      ui.SafetyRadar4_15_Semi->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafetyRadar4_15_Semi->setPalette(color);
    }
  }
  else if(CarTypeStatus == 4)
  {
    //右侧雷达报警
    if(SafeRadarStatus_R < 8 && SafeRadarStatus_R >=0)
    {
      switch(SafeRadarStatus_R)
      {
        case 0: word_str = QString::fromLocal8Bit("区域1、2、3"); break;
        case 1: word_str = QString::fromLocal8Bit("区域2、3"); break;
        case 2: word_str = QString::fromLocal8Bit("区域1、3"); break;
        case 3: word_str = QString::fromLocal8Bit("区域3"); break;
        case 4: word_str = QString::fromLocal8Bit("区域1、2"); break;
        case 5: word_str = QString::fromLocal8Bit("区域2"); break;
        case 6: word_str = QString::fromLocal8Bit("区域1"); break;
        case 7: word_str = QString::fromLocal8Bit("区域无障碍"); break;
        default: break;
      }

      ui.RadarRight_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.RadarRight_Cotton->setScaledContents(true);

      ui.RadarRight_2_Cotton->setFont(font);
      ui.RadarRight_2_Cotton->setText(QString(word_str));                //显示页数
      ui.RadarRight_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RadarRight_2_Cotton->setPalette(color);

      ui.SafrtyRadarControl_R_Cotton_La->setFont(font);
      ui.SafrtyRadarControl_R_Cotton_La->setText(QString(word_str));                //显示页数
      ui.SafrtyRadarControl_R_Cotton_La->setAlignment(Qt::AlignLeft);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafrtyRadarControl_R_Cotton_La->setPalette(color);
    }

//左侧雷达
//    SafeRadarStatus_L = 1;
    if(SafeRadarStatus_L < 8 && SafeRadarStatus_L >=0)
    {
      switch(SafeRadarStatus_L)
      {
        case 0: word_str = QString::fromLocal8Bit("区域1、2、3"); break;
        case 1: word_str = QString::fromLocal8Bit("区域2、3"); break;
        case 2: word_str = QString::fromLocal8Bit("区域1、3"); break;
        case 3: word_str = QString::fromLocal8Bit("区域3"); break;
        case 4: word_str = QString::fromLocal8Bit("区域1、2"); break;
        case 5: word_str = QString::fromLocal8Bit("区域2"); break;
        case 6: word_str = QString::fromLocal8Bit("区域1"); break;
        case 7: word_str = QString::fromLocal8Bit("区域无障碍"); break;
        default: break;
      }

      ui.RadarLeft_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.RadarLeft_Cotton->setScaledContents(true);

      ui.RadarLeft_2_Cotton->setFont(font);
      ui.RadarLeft_2_Cotton->setText(QString(word_str));                //显示页数
      ui.RadarLeft_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RadarLeft_2_Cotton->setPalette(color);

      ui.SafrtyRadarControl_L_Cotton_La->setFont(font);
      ui.SafrtyRadarControl_L_Cotton_La->setText(QString(word_str));                //显示页数
      ui.SafrtyRadarControl_L_Cotton_La->setAlignment(Qt::AlignLeft);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafrtyRadarControl_L_Cotton_La->setPalette(color);
    }

    //急停
    if(rtu3072.ch.bit8_emergency1 == 1)
    {
      ui.Stop_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Stop_Cotton->setScaledContents(true);

      ui.Stop_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("急停拍下");
      ui.Stop_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Stop_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Stop_2_Cotton->setPalette(color);
    }
    else
    {
      ui.Stop_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Stop_Cotton->setScaledContents(true);

      ui.Stop_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("急停松开");
      ui.Stop_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Stop_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Stop_2_Cotton->setPalette(color);
    }

    //手自动
    if(rtu3072.ch.bit9_autoChange == 1)
    {
      ui.AutoM_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.AutoM_Cotton->setScaledContents(true);

      ui.AutoM_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("自动");
      ui.AutoM_2_Cotton->setText(QString(word_str));                //显示页数
      ui.AutoM_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.AutoM_2_Cotton->setPalette(color);
    }
    else
    {
      ui.AutoM_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.AutoM_Cotton->setScaledContents(true);

      ui.AutoM_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("手动");
      ui.AutoM_2_Cotton->setText(QString(word_str));                //显示页数
      ui.AutoM_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.AutoM_2_Cotton->setPalette(color);
    }

    //防撞条
    if(rtu3072.ch.bit10_impact== 1)
    {
      ui.Impact_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Impact_Cotton->setScaledContents(true);

      ui.Impact_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("防撞报警");
      ui.Impact_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Impact_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Impact_2_Cotton->setPalette(color);
    }
    else
    {
      ui.Impact_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Impact_Cotton->setScaledContents(true);

      ui.Impact_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未报警");
      ui.Impact_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Impact_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Impact_2_Cotton->setPalette(color);
    }

    //掉筒检测传感器
    if(rtu3072.ch.bit11_clearanceLampSignal == 1)
    {
      ui.Light_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Light_Cotton->setScaledContents(true);

      ui.Light_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Light_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Light_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Light_2_Cotton->setPalette(color);
    }
    else
    {
      ui.Light_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Light_Cotton->setScaledContents(true);

      ui.Light_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Light_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Light_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Light_2_Cotton->setPalette(color);
    }

    //棉包夹下限位
    if(rtu3072.ch.bit12_clipDownLimmit == 1)
    {
      ui.DownLimit_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.DownLimit_Cotton->setScaledContents(true);

      ui.DownLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.DownLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.DownLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.DownLimit_2_Cotton->setPalette(color);
    }
    else
    {
      ui.DownLimit_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.DownLimit_Cotton->setScaledContents(true);

      ui.DownLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.DownLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.DownLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.DownLimit_2_Cotton->setPalette(color);
    }

    //棉包夹上限位
    if(rtu3072.ch.bit13_clipUpLimmit == 1)
    {
      ui.Upperlimit_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Upperlimit_Cotton->setScaledContents(true);

      ui.Upperlimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Upperlimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Upperlimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Upperlimit_2_Cotton->setPalette(color);
    }
    else
    {
      ui.Upperlimit_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Upperlimit_Cotton->setScaledContents(true);

      ui.Upperlimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Upperlimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Upperlimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Upperlimit_2_Cotton->setPalette(color);
    }

    //棉包夹抬升限位
    if(rtu3072.ch.bit14_clipUpArrive == 1)
    {
      ui.UpLiftLimit_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.UpLiftLimit_Cotton->setScaledContents(true);

      ui.UpLiftLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.UpLiftLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.UpLiftLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.UpLiftLimit_2_Cotton->setPalette(color);
    }
    else
    {
      ui.UpLiftLimit_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.UpLiftLimit_Cotton->setScaledContents(true);

      ui.UpLiftLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.UpLiftLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.UpLiftLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.UpLiftLimit_2_Cotton->setPalette(color);
    }

    //棉包夹滑落检测
    if(rtu3072.ch.bit15_checkDrop == 0)
    {
      ui.DropPackage_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.DropPackage_Cotton->setScaledContents(true);

      ui.DropPackage_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.DropPackage_2_Cotton->setText(QString(word_str));                //显示页数
      ui.DropPackage_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.DropPackage_2_Cotton->setPalette(color);
    }
    else
    {
      ui.DropPackage_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.DropPackage_Cotton->setScaledContents(true);

      ui.DropPackage_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.DropPackage_2_Cotton->setText(QString(word_str));                //显示页数
      ui.DropPackage_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.DropPackage_2_Cotton->setPalette(color);
    }

    //棉包左夹开限位
    if(rtu3071.ch.bit0_clipLeftOpen == 1)
    {
      ui.LeftOpenLimit_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.LeftOpenLimit_Cotton->setScaledContents(true);

      ui.LeftOpenLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.LeftOpenLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.LeftOpenLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.LeftOpenLimit_2_Cotton->setPalette(color);
    }
    else
    {
      ui.LeftOpenLimit_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.LeftOpenLimit_Cotton->setScaledContents(true);

      ui.LeftOpenLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.LeftOpenLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.LeftOpenLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.LeftOpenLimit_2_Cotton->setPalette(color);
    }

    //棉包左夹关限位
    if(rtu3071.ch.bit1_clipLeftClose == 1)
    {
      ui.LeftCloseLimit_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.LeftCloseLimit_Cotton->setScaledContents(true);

      ui.LeftCloseLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.LeftCloseLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.LeftCloseLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.LeftCloseLimit_2_Cotton->setPalette(color);
    }
    else
    {
      ui.LeftCloseLimit_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.LeftCloseLimit_Cotton->setScaledContents(true);

      ui.LeftCloseLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.LeftCloseLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.LeftCloseLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.LeftCloseLimit_2_Cotton->setPalette(color);
    }

    //棉包右夹开限位
    if(rtu3071.ch.bit2_clipRightOpen == 1)
    {
      ui.RightOpenLimit_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.RightOpenLimit_Cotton->setScaledContents(true);

      ui.RightOpenLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.RightOpenLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.RightOpenLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RightOpenLimit_2_Cotton->setPalette(color);
    }
    else
    {
      ui.RightOpenLimit_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.RightOpenLimit_Cotton->setScaledContents(true);

      ui.RightOpenLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.RightOpenLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.RightOpenLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RightOpenLimit_2_Cotton->setPalette(color);
    }

    //棉包右夹关限位
    if(rtu3071.ch.bit3_clipRightClose == 1)
    {
      ui.RightCloseLimit_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.RightCloseLimit_Cotton->setScaledContents(true);

      ui.RightCloseLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.RightCloseLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.RightCloseLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RightCloseLimit_2_Cotton->setPalette(color);
    }
    else
    {
      ui.RightCloseLimit_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.RightCloseLimit_Cotton->setScaledContents(true);

      ui.RightCloseLimit_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.RightCloseLimit_2_Cotton->setText(QString(word_str));                //显示页数
      ui.RightCloseLimit_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RightCloseLimit_2_Cotton->setPalette(color);
    }

    //光电开关11
    if(rtu3071.ch.bit4_clampCheck1 == 1)
    {
      ui.Photoelectric11_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Photoelectric11_Cotton->setScaledContents(true);

      ui.Photoelectric11_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Photoelectric11_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Photoelectric11_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric11_2_Cotton->setPalette(color);
    }
    else
    {
      ui.Photoelectric11_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Photoelectric11_Cotton->setScaledContents(true);

      ui.Photoelectric11_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Photoelectric11_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Photoelectric11_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric11_2_Cotton->setPalette(color);
    }

    //光电开关12
    if(rtu3071.ch.bit5_clampCheck2 == 1)
    {
      ui.Photoelectric12_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Photoelectric12_Cotton->setScaledContents(true);

      ui.Photoelectric12_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Photoelectric12_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Photoelectric12_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric12_2_Cotton->setPalette(color);
    }
    else
    {
      ui.Photoelectric12_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Photoelectric12_Cotton->setScaledContents(true);

      ui.Photoelectric12_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Photoelectric12_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Photoelectric12_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric12_2_Cotton->setPalette(color);
    }

    //光电开关21
    if(rtu3071.ch.bit6_clampCheck3 == 1)
    {
      ui.Photoelectric21_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Photoelectric21_Cotton->setScaledContents(true);

      ui.Photoelectric21_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Photoelectric21_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Photoelectric21_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric21_2_Cotton->setPalette(color);
    }
    else
    {
      ui.Photoelectric21_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Photoelectric21_Cotton->setScaledContents(true);

      ui.Photoelectric21_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Photoelectric21_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Photoelectric21_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric21_2_Cotton->setPalette(color);
    }

    //光电开关22
    if(rtu3071.ch.bit7_clampCheck4 == 1)
    {
      ui.Photoelectric22_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Photoelectric22_Cotton->setScaledContents(true);

      ui.Photoelectric22_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Photoelectric22_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Photoelectric22_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric22_2_Cotton->setPalette(color);
    }
    else
    {
      ui.Photoelectric22_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Photoelectric22_Cotton->setScaledContents(true);

      ui.Photoelectric22_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Photoelectric22_2_Cotton->setText(QString(word_str));                //显示页数
      ui.Photoelectric22_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric22_2_Cotton->setPalette(color);
    }

    //棉包在位检测
    if(rtu3071.ch.bit8_checkGoods == 1)
    {
      ui.HavePackage_Cotton->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.HavePackage_Cotton->setScaledContents(true);

      ui.HavePackage_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.HavePackage_2_Cotton->setText(QString(word_str));                //显示页数
      ui.HavePackage_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.HavePackage_2_Cotton->setPalette(color);
    }
    else
    {
      ui.HavePackage_Cotton->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.HavePackage_Cotton->setScaledContents(true);

      ui.HavePackage_2_Cotton->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.HavePackage_2_Cotton->setText(QString(word_str));                //显示页数
      ui.HavePackage_2_Cotton->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.HavePackage_2_Cotton->setPalette(color);
    }

    if(control_send_re_.sw.b.safeLamp == agv_sw_state_.swState.b.safeLamp)
    {
      if(agv_sw_state_.swState.b.safeLamp == 1)
      {
        ui.LightBtn_Cotton->setIcon(QIcon(":/image/chache/OpenBtn.png"));
      }
      else
      {
        ui.LightBtn_Cotton->setIcon(QIcon(":/image/chache/CloseBtn.png"));
      }

      SafeLamp = agv_sw_state_.swState.b.safeLamp;
    }
  }
  else if(CarTypeStatus == 5)
  {
    QPalette color;
    QString word_str;
    QFont font;
    font.setPointSize(WORD_SIZE);

    //右侧雷达报警
    if(SafeRadarStatus_R < 8 && SafeRadarStatus_R >=0)
    {
      switch(SafeRadarStatus_R)
      {
        case 0: word_str = QString::fromLocal8Bit("区域1、2、3"); break;
        case 1: word_str = QString::fromLocal8Bit("区域2、3"); break;
        case 2: word_str = QString::fromLocal8Bit("区域1、3"); break;
        case 3: word_str = QString::fromLocal8Bit("区域3"); break;
        case 4: word_str = QString::fromLocal8Bit("区域1、2"); break;
        case 5: word_str = QString::fromLocal8Bit("区域2"); break;
        case 6: word_str = QString::fromLocal8Bit("区域1"); break;
        case 7: word_str = QString::fromLocal8Bit("区域无障碍"); break;
        default: break;
      }

      ui.RadarRight_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.RadarRight_fork->setScaledContents(true);

      ui.RadarRight_2_fork->setFont(font);
      ui.RadarRight_2_fork->setText(QString(word_str));                //显示页数
      ui.RadarRight_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RadarRight_2_fork->setPalette(color);

      ui.SafrtyRadarControl_R_Cotton_La->setFont(font);
      ui.SafrtyRadarControl_R_Cotton_La->setText(QString(word_str));                //显示页数
      ui.SafrtyRadarControl_R_Cotton_La->setAlignment(Qt::AlignLeft);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafrtyRadarControl_R_Cotton_La->setPalette(color);
    }

//左侧雷达
//    SafeRadarStatus_L = 1;
    if(SafeRadarStatus_L < 8 && SafeRadarStatus_L >=0)
    {
      switch(SafeRadarStatus_L)
      {
        case 0: word_str = QString::fromLocal8Bit("区域1、2、3"); break;
        case 1: word_str = QString::fromLocal8Bit("区域2、3"); break;
        case 2: word_str = QString::fromLocal8Bit("区域1、3"); break;
        case 3: word_str = QString::fromLocal8Bit("区域3"); break;
        case 4: word_str = QString::fromLocal8Bit("区域1、2"); break;
        case 5: word_str = QString::fromLocal8Bit("区域2"); break;
        case 6: word_str = QString::fromLocal8Bit("区域1"); break;
        case 7: word_str = QString::fromLocal8Bit("区域无障碍"); break;
        default: break;
      }

      ui.RadarLeft_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.RadarLeft_fork->setScaledContents(true);

      ui.RadarLeft_2_fork->setFont(font);
      ui.RadarLeft_2_fork->setText(QString(word_str));                //显示页数
      ui.RadarLeft_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RadarLeft_2_fork->setPalette(color);

      ui.SafrtyRadarControl_L_Cotton_La->setFont(font);
      ui.SafrtyRadarControl_L_Cotton_La->setText(QString(word_str));                //显示页数
      ui.SafrtyRadarControl_L_Cotton_La->setAlignment(Qt::AlignLeft);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.SafrtyRadarControl_L_Cotton_La->setPalette(color);
    }

    //急停
    if(rtu_317f_s.in.ch.bit0_sgnEmergency == 1)
    {
      ui.Stop_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Stop_fork->setScaledContents(true);

      ui.Stop_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("急停拍下");
      ui.Stop_2_fork->setText(QString(word_str));                //显示页数
      ui.Stop_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Stop_2_fork->setPalette(color);
    }
    else
    {
      ui.Stop_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Stop_fork->setScaledContents(true);

      ui.Stop_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("急停松开");
      ui.Stop_2_fork->setText(QString(word_str));                //显示页数
      ui.Stop_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Stop_2_fork->setPalette(color);
    }

    //手自动
    if(rtu_317f_s.in.ch.bit1_sgnAutoKey == 1)
    {
      ui.AutoM_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.AutoM_fork->setScaledContents(true);

      ui.AutoM_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("自动");
      ui.AutoM_2_fork->setText(QString(word_str));                //显示页数
      ui.AutoM_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.AutoM_2_fork->setPalette(color);
    }
    else
    {
      ui.AutoM_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.AutoM_fork->setScaledContents(true);

      ui.AutoM_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("手动");
      ui.AutoM_2_fork->setText(QString(word_str));                //显示页数
      ui.AutoM_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.AutoM_2_fork->setPalette(color);
    }

    //防撞条
    if(rtu_317f_s.in.ch.bit2_sgnImpact== 1)
    {
      ui.Impact_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Impact_fork->setScaledContents(true);

      ui.Impact_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("防撞报警");
      ui.Impact_2_fork->setText(QString(word_str));                //显示页数
      ui.Impact_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Impact_2_fork->setPalette(color);
    }
    else
    {
      ui.Impact_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Impact_fork->setScaledContents(true);

      ui.Impact_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未报警");
      ui.Impact_2_fork->setText(QString(word_str));                //显示页数
      ui.Impact_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Impact_2_fork->setPalette(color);
    }

    //示廓灯
    if(rtu_317f_s.in.ch.bit3_sgnContourLight == 1)
    {
      ui.Light_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Light_fork->setScaledContents(true);

      ui.Light_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Light_2_fork->setText(QString(word_str));                //显示页数
      ui.Light_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Light_2_fork->setPalette(color);
    }
    else
    {
      ui.Light_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Light_fork->setScaledContents(true);

      ui.Light_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Light_2_fork->setText(QString(word_str));                //显示页数
      ui.Light_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Light_2_fork->setPalette(color);
    }

    //叉车叉子下限位
    if(rtu_317f_s.in.ch.bit5_sgnForkDownLmt == 1)
    {
      ui.DownLimit_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.DownLimit_fork->setScaledContents(true);

      ui.DownLimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.DownLimit_2_fork->setText(QString(word_str));                //显示页数
      ui.DownLimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.DownLimit_2_fork->setPalette(color);
    }
    else
    {
      ui.DownLimit_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.DownLimit_fork->setScaledContents(true);

      ui.DownLimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.DownLimit_2_fork->setText(QString(word_str));                //显示页数
      ui.DownLimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.DownLimit_2_fork->setPalette(color);
    }

    //叉车叉子上限位
    if(rtu_317f_s.in.ch.bit6_sgnForkUpLmt == 1)
    {
      ui.Upperlimit_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Upperlimit_fork->setScaledContents(true);

      ui.Upperlimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Upperlimit_2_fork->setText(QString(word_str));                //显示页数
      ui.Upperlimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Upperlimit_2_fork->setPalette(color);
    }
    else
    {
      ui.Upperlimit_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Upperlimit_fork->setScaledContents(true);

      ui.Upperlimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Upperlimit_2_fork->setText(QString(word_str));                //显示页数
      ui.Upperlimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Upperlimit_2_fork->setPalette(color);
    }

    //叉车叉子抬升限位
    if(rtu_317f_s.in.ch.bit7_sgnForkMiddleLmt == 1)
    {
      ui.UpLiftLimit_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.UpLiftLimit_fork->setScaledContents(true);

      ui.UpLiftLimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.UpLiftLimit_2_fork->setText(QString(word_str));                //显示页数
      ui.UpLiftLimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.UpLiftLimit_2_fork->setPalette(color);
    }
    else
    {
      ui.UpLiftLimit_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.UpLiftLimit_fork->setScaledContents(true);

      ui.UpLiftLimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.UpLiftLimit_2_fork->setText(QString(word_str));                //显示页数
      ui.UpLiftLimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.UpLiftLimit_2_fork->setPalette(color);
    }

//    //棉包夹滑落检测1
//    if(rtu_317f_s.in.ch.bit12_sgnForkGoodsImpact == 1)
//    {
//      ui.DropPackage_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
//      ui.DropPackage_fork->setScaledContents(true);
//      ui.DropPackage_2_fork->setFont(font);
//      word_str = QString::fromLocal8Bit("已触发");
//      ui.DropPackage_2_fork->setText(QString(word_str));                //显示页数
//      ui.DropPackage_2_fork->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.DropPackage_2_fork->setPalette(color);
//    }
//    else
//    {
//      ui.DropPackage_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
//      ui.DropPackage_fork->setScaledContents(true);

//      ui.DropPackage_2_fork->setFont(font);
//      word_str = QString::fromLocal8Bit("未触发");
//      ui.DropPackage_2_fork->setText(QString(word_str));                //显示页数
//      ui.DropPackage_2_fork->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.DropPackage_2_fork->setPalette(color);
//    }

//    //棉包夹滑落检测2
//    if(rtu_317f_s.in.ch.bit13_sgnForkGoodsImpact == 1)
//    {
//      ui.LeftOpenLimit_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
//      ui.LeftOpenLimit_fork->setScaledContents(true);

//      ui.LeftOpenLimit_2_fork->setFont(font);
//      word_str = QString::fromLocal8Bit("已触发");
//      ui.LeftOpenLimit_2_fork->setText(QString(word_str));                //显示页数
//      ui.LeftOpenLimit_2_fork->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.LeftOpenLimit_2_fork->setPalette(color);
//    }
//    else
//    {
//      ui.LeftOpenLimit_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
//      ui.LeftOpenLimit_fork->setScaledContents(true);

//      ui.LeftOpenLimit_2_fork->setFont(font);
//      word_str = QString::fromLocal8Bit("未触发");
//      ui.LeftOpenLimit_2_fork->setText(QString(word_str));                //显示页数
//      ui.LeftOpenLimit_2_fork->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.LeftOpenLimit_2_fork->setPalette(color);
//    }

    //叉车尾部光电左
    if(rtu_317f_s.in.ch.bit8_sgnForkTail == 1)
    {
      ui.LeftCloseLimit_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.LeftCloseLimit_fork->setScaledContents(true);

      ui.LeftCloseLimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.LeftCloseLimit_2_fork->setText(QString(word_str));                //显示页数
      ui.LeftCloseLimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.LeftCloseLimit_2_fork->setPalette(color);
    }
    else
    {
      ui.LeftCloseLimit_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.LeftCloseLimit_fork->setScaledContents(true);

      ui.LeftCloseLimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.LeftCloseLimit_2_fork->setText(QString(word_str));                //显示页数
      ui.LeftCloseLimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.LeftCloseLimit_2_fork->setPalette(color);
    }

    //叉车尾部光电右
    if(rtu_317f_s.in.ch.bit9_sgnForkTail == 1)
    {
      ui.RightOpenLimit_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.RightOpenLimit_fork->setScaledContents(true);

      ui.RightOpenLimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.RightOpenLimit_2_fork->setText(QString(word_str));                //显示页数
      ui.RightOpenLimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RightOpenLimit_2_fork->setPalette(color);
    }
    else
    {
      ui.RightOpenLimit_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.RightOpenLimit_fork->setScaledContents(true);

      ui.RightOpenLimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.RightOpenLimit_2_fork->setText(QString(word_str));                //显示页数
      ui.RightOpenLimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RightOpenLimit_2_fork->setPalette(color);
    }

    //棉包右夹关限位
    if(rtu317_fork.in.ch.bit5_charging == 1)
    {
      ui.RightCloseLimit_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.RightCloseLimit_fork->setScaledContents(true);

      ui.RightCloseLimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.RightCloseLimit_2_fork->setText(QString(word_str));                //显示页数
      ui.RightCloseLimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RightCloseLimit_2_fork->setPalette(color);
    }
    else
    {
      ui.RightCloseLimit_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.RightCloseLimit_fork->setScaledContents(true);

      ui.RightCloseLimit_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.RightCloseLimit_2_fork->setText(QString(word_str));                //显示页数
      ui.RightCloseLimit_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.RightCloseLimit_2_fork->setPalette(color);
    }

    //光电开关11
    if(rtu308k.in.ch.bit1_goodsTouch1 == 1)
    {
      ui.Photoelectric11_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Photoelectric11_fork->setScaledContents(true);

      ui.Photoelectric11_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Photoelectric11_2_fork->setText(QString(word_str));                //显示页数
      ui.Photoelectric11_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric11_2_fork->setPalette(color);
    }
    else
    {
      ui.Photoelectric11_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Photoelectric11_fork->setScaledContents(true);

      ui.Photoelectric11_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Photoelectric11_2_fork->setText(QString(word_str));                //显示页数
      ui.Photoelectric11_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric11_2_fork->setPalette(color);
    }

    //光电开关12
    if(rtu308k.in.ch.bit2_goodsTouch2 == 1)
    {
      ui.Photoelectric12_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Photoelectric12_fork->setScaledContents(true);

      ui.Photoelectric12_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Photoelectric12_2_fork->setText(QString(word_str));                //显示页数
      ui.Photoelectric12_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric12_2_fork->setPalette(color);
    }
    else
    {
      ui.Photoelectric12_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Photoelectric12_fork->setScaledContents(true);

      ui.Photoelectric12_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Photoelectric12_2_fork->setText(QString(word_str));                //显示页数
      ui.Photoelectric12_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric12_2_fork->setPalette(color);
    }

    //光电开关21
    if(rtu308k.in.ch.bit3_goodsAway1 == 1)
    {
      ui.Photoelectric21_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Photoelectric21_fork->setScaledContents(true);

      ui.Photoelectric21_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Photoelectric21_2_fork->setText(QString(word_str));                //显示页数
      ui.Photoelectric21_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric21_2_fork->setPalette(color);
    }
    else
    {
      ui.Photoelectric21_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Photoelectric21_fork->setScaledContents(true);

      ui.Photoelectric21_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Photoelectric21_2_fork->setText(QString(word_str));                //显示页数
      ui.Photoelectric21_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric21_2_fork->setPalette(color);
    }

    //光电开关22
    if(rtu308k.in.ch.bit4_goodsAway2 == 1)
    {
      ui.Photoelectric22_fork->setPixmap(QPixmap(":/image/chache/longred.png"));
      ui.Photoelectric22_fork->setScaledContents(true);

      ui.Photoelectric22_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("已触发");
      ui.Photoelectric22_2_fork->setText(QString(word_str));                //显示页数
      ui.Photoelectric22_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric22_2_fork->setPalette(color);
    }
    else
    {
      ui.Photoelectric22_fork->setPixmap(QPixmap(":/image/chache/longgreen.png"));
      ui.Photoelectric22_fork->setScaledContents(true);

      ui.Photoelectric22_2_fork->setFont(font);
      word_str = QString::fromLocal8Bit("未触发");
      ui.Photoelectric22_2_fork->setText(QString(word_str));                //显示页数
      ui.Photoelectric22_2_fork->setAlignment(Qt::AlignCenter);
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Photoelectric22_2_fork->setPalette(color);
    }

//    //棉包在位检测
//    if(rtu3071.ch.bit8_checkGoods == 1)
//    {
////        font.setPointSize(WORD_SIZE);
////        ui.HavePackage->setFont(font);
////        word_str = QString::fromLocal8Bit("已触发");
////        ui.HavePackage->setText(QString(word_str));                //显示页数
////        color.setColor(QPalette::WindowText,Qt::red);
////        ui.HavePackage->setPalette(color);

//      ui.HavePackage->setPixmap(QPixmap(":/image/chache/longred.png"));
//      ui.HavePackage->setScaledContents(true);

//      ui.HavePackage_2->setFont(font);
//      word_str = QString::fromLocal8Bit("已触发");
//      ui.HavePackage_2->setText(QString(word_str));                //显示页数
//      ui.HavePackage_2->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.HavePackage_2->setPalette(color);
//    }
//    else
//    {
////        font.setPointSize(WORD_SIZE);
////        ui.HavePackage->setFont(font);
////        word_str = QString::fromLocal8Bit("未触发");
////        ui.HavePackage->setText(QString(word_str));                //显示页数
////        color.setColor(QPalette::WindowText,Qt::green);
////        ui.HavePackage->setPalette(color);

//      ui.HavePackage->setPixmap(QPixmap(":/image/chache/longgreen.png"));
//      ui.HavePackage->setScaledContents(true);

//      ui.HavePackage_2->setFont(font);
//      word_str = QString::fromLocal8Bit("未触发");
//      ui.HavePackage_2->setText(QString(word_str));                //显示页数
//      ui.HavePackage_2->setAlignment(Qt::AlignCenter);
//      color.setColor(QPalette::WindowText,Qt::white);
//      ui.HavePackage_2->setPalette(color);
//    }

//    if(control_send_re_.sw.b.safeLamp == agv_sw_state_.swState.b.safeLamp)
//    {
//      if(agv_sw_state_.swState.b.safeLamp == 1)
//      {
//        ui.LightBtn_fork->setIcon(QIcon(":/image/chache/OpenBtn.png"));
//      }
//      else
//      {
//        ui.LightBtn_fork->setIcon(QIcon(":/image/chache/CloseBtn.png"));
//      }

//      SafeLamp = agv_sw_state_.swState.b.safeLamp;
//    }
  }
}

//系统界面显示
void MainWindow::System_Show()
{
  QString word_str;
  QPalette color;
  QFont font;
  font.setPointSize(22);

  QString num;

  num = QString::number(sys_config_receive_.head.bit.cfg, 10);
  ui.ConfigStatus->setText(num);
  ui.ConfigStatus->setFont(font);

  num = QString::number(sys_config_receive_.test, 10);
  ui.TestStatus->setText(num);
  ui.TestStatus->setFont(font);

  num = QString::number(sys_config_receive_.actuator, 10);
  ui.Actuator->setText(num);
  ui.Actuator->setFont(font);

  num = QString::number(sys_config_receive_.wheel, 10);
  ui.Wheel->setText(num);
  ui.Wheel->setFont(font);

  num = QString::number(sys_config_receive_.carTray, 10);
  ui.CarTray->setText(num);
  ui.CarTray->setFont(font);

  num = QString::number(sys_config_receive_.motor, 10);
  ui.MotorType->setText(num);
  ui.MotorType->setFont(font);

  num = QString::number(sys_config_receive_.leadScrew, 10);
  ui.LeadScrew->setText(num);
  ui.LeadScrew->setFont(font);

  num = QString::number(sys_config_receive_.sensorMode, 10);
  ui.SensorMode->setText(num);
  ui.SensorMode->setFont(font);

  num = QString::number(sys_config_receive_.ergImu, 10);
  ui.IMUData->setText(num);
  ui.IMUData->setFont(font);

  num = QString::number(sys_config_receive_.swhorn, 10);
  ui.SwHorn->setText(num);
  ui.SwHorn->setFont(font);

  num = QString::number(sys_config_receive_.swimpact, 10);
  ui.ImpactStatus->setText(num);
  ui.ImpactStatus->setFont(font);

  num = QString::number(sys_config_receive_.cfig2, 10);
  ui.WheelType->setText(num);
  ui.WheelType->setFont(font);

  num = QString::number(sys_config_receive_.cfig3, 10);
  ui.Reduction->setText(num);
  ui.Reduction->setFont(font);

  num = QString::number(treadAll);
  ui.WheelTread->setText(num);
  ui.WheelTread->setFont(font);

  num = QString::number(axleAll);
  ui.WheelAxle->setText(num);
  ui.WheelAxle->setFont(font);

//    num = QString("%1").arg(treadAll);
//    ui.RobotAxis->setText(num);
//    ui.RobotAxis->setFont(font);
//  if(CarTypeStatus == 4 || CarTypeStatus == 5)
  {
    num = QString::number(mechanical_param_.robot_type, 10);
    ui.RobotType_Cotton->setText(num);
    ui.RobotType_Cotton->setFont(font);

    num = QString("%1").arg(mechanical_param_.axis_length);
    ui.RobotAxis_Cotton->setText(num);
    ui.RobotAxis_Cotton->setFont(font);

    num = QString("%1").arg(mechanical_param_.encoder_lines);
    ui.RobotEncoderLine_Cotton->setText(num);
    ui.RobotEncoderLine_Cotton->setFont(font);

    num = QString("%1").arg(mechanical_param_.reduction_ratio);
    ui.RobotRatio_Cotton->setText(num);
    ui.RobotRatio_Cotton->setFont(font);

    num = QString("%1").arg(mechanical_param_.wheel_length);
    ui.RobotWheelLen_Cotton->setText(num);
    ui.RobotWheelLen_Cotton->setFont(font);

    num = QString("%1").arg(mechanical_param_.wheel_r);
    ui.RobotWheelR_Cotton->setText(num);
    ui.RobotWheelR_Cotton->setFont(font);

    QString word_str;
    QPalette color;
    QFont font;

    font.setPointSize(WARNING_WORD_SIZE_20);
    ui.Ecoline_Cotton_label->setFont(font);
    word_str = QString::fromLocal8Bit("拉线传感器");
    ui.Ecoline_Cotton_label->setText(QString(word_str));
    if(ecolineInfo_[0].state.b.online == 0)
    {
      color.setColor(QPalette::WindowText,Qt::yellow);
      ui.Ecoline_Cotton_label->setPalette(color);
    }
    else
    {
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Ecoline_Cotton_label->setPalette(color);
    }

    num = QString("%1").arg(ecolineInfo_[0].value);
    ui.Ecoline_Cotton->setText(num);
    ui.Ecoline_Cotton->setFont(font);

    font.setPointSize(WARNING_WORD_SIZE_20);
    ui.Manometer_Cotton_label->setFont(font);
    word_str = QString::fromLocal8Bit("压力计");
    ui.Manometer_Cotton_label->setText(QString(word_str));
    if(ecolineInfo_[1].state.b.online == 0 || ecolineInfo_[1].value == 4000)
    {
      color.setColor(QPalette::WindowText,Qt::yellow);
      ui.Manometer_Cotton_label->setPalette(color);
    }
    else
    {
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Manometer_Cotton_label->setPalette(color);
    }

    num = QString("%1").arg(ecolineInfo_[1].value );
    ui.Manometer_Cotton->setText(num);
    ui.Manometer_Cotton->setFont(font);

    font.setPointSize(WARNING_WORD_SIZE_20);
    ui.Ruler_Cotton_label->setFont(font);
    word_str = QString::fromLocal8Bit("电子尺");
    ui.Ruler_Cotton_label->setText(QString(word_str));
    if(ecolineInfo_[2].state.b.online == 0)
    {
      color.setColor(QPalette::WindowText,Qt::yellow);
      ui.Ruler_Cotton_label->setPalette(color);
    }
    else
    {
      color.setColor(QPalette::WindowText,Qt::white);
      ui.Ruler_Cotton_label->setPalette(color);
    }

    num = QString("%1").arg(ecolineInfo_[2].value );
    ui.Ruler_Cotton->setText(num);
    ui.Ruler_Cotton->setFont(font);

    num = QString::number(errmask_Cotton_.mask.b.radarArea101, 10);
    ui.SafrtyRadarControl_L_show_Cotton->setText(num);
    ui.SafrtyRadarControl_L_show_Cotton->setFont(font);

    num = QString::number(errmask_Cotton_.mask.b.radarArea201, 10);
    ui.SafrtyRadarControl_R_show_Cotton->setText(num);
    ui.SafrtyRadarControl_R_show_Cotton->setFont(font);

    //显示雷达
    if(errmask_Cotton_.mask.b.impact == 1)
    {
      ui.ImpactControl_Cotton->setIcon(QIcon(":/image/chache/OpenGreen.png"));
      ui.ImpactControl_2_Cotton->setIcon(QIcon(":/image/chache/CloseBlue.png"));
    }
    else
    {
      ui.ImpactControl_Cotton->setIcon(QIcon(":/image/chache/OpenBlue.png"));
      ui.ImpactControl_2_Cotton->setIcon(QIcon(":/image/chache/CloseRed.png"));
    }

    if(cleanChargeMode == 1)
    {
      ui.ChargingOpen_Cotton->setIcon(QIcon(":/image/chache/OpenGreen.png"));
      ui.ChargingClose_Cotton->setIcon(QIcon(":/image/chache/CloseBlue.png"));
    }
    else
    {
      ui.ChargingOpen_Cotton->setIcon(QIcon(":/image/chache/OpenBlue.png"));
      ui.ChargingClose_Cotton->setIcon(QIcon(":/image/chache/CloseRed.png"));
    }
  }

}

//电池信息界面显示
void MainWindow::BatteryInfoShow()
{
  QString word_str;
  QPalette color;
  QFont font;                                                                             //设置字体大小

  //电池编号
  font.setPointSize(WORD_SIZE);
  ui.Number_3->setFont(font);
  word_str = QString::number(battery_status_.serialNum, 10);
  ui.Number_3->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.Number_3->setPalette(color);

  //电池电量
  font.setPointSize(WORD_SIZE);
  ui.Percentage->setFont(font);
  word_str = QString::number(battery_status_.percentage, 10);                              //char型转qstring型
  ui.Percentage->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.Percentage->setPalette(color);

  //电池电压
  font.setPointSize(WORD_SIZE);
  ui.Voltage->setFont(font);
  word_str = QString::number(battery_status_.voltage, 10);                            //char型转qstring型
  ui.Voltage->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.Voltage->setPalette(color);

  //电池电流
  font.setPointSize(WORD_SIZE);
  ui.Current->setFont(font);
  word_str = QString::number(battery_status_.current, 10);                            //char型转qstring型
  ui.Current->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.Current->setPalette(color);

  //电池温度
  font.setPointSize(WORD_SIZE);
  ui.Temperture->setFont(font);
  word_str = QString::number(battery_status_.temperature, 10);                            //char型转qstring型
  ui.Temperture->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.Temperture->setPalette(color);

  //电池错误码
  font.setPointSize(WORD_SIZE);
  ui.ErrorCode->setFont(font);
  word_str = QString::number(battery_status_.errorCode, 10);                            //char型转qstring型
  ui.ErrorCode->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.ErrorCode->setPalette(color);

  //////////状态/////////////////////
  //电池在线状态
  font.setPointSize(WORD_SIZE);
  ui.OnlineStatus->setFont(font);
  word_str = QString::number(battery_status_.state.b.online, 10);                            //char型转qstring型
  ui.OnlineStatus->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.OnlineStatus->setPalette(color);

  //电池低电量状态
  font.setPointSize(WORD_SIZE);
  ui.LowPowerStatus->setFont(font);
  word_str = QString::number(battery_status_.state.b.powerLow, 10);                            //char型转qstring型
  ui.LowPowerStatus->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.LowPowerStatus->setPalette(color);

  //电池充电状态
  font.setPointSize(WORD_SIZE);
  ui.ChargeStatus->setFont(font);
  word_str = QString::number(battery_status_.state.b.charging, 10);                            //char型转qstring型
  ui.ChargeStatus->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.ChargeStatus->setPalette(color);

  //电池电压状态
  font.setPointSize(WORD_SIZE);
  ui.VolageStatus->setFont(font);
  word_str = QString::number(battery_status_.state.b.voltage, 10);                            //char型转qstring型
  ui.VolageStatus->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.VolageStatus->setPalette(color);

  //电池电流状态
  font.setPointSize(WORD_SIZE);
  ui.CurrentStatus->setFont(font);
  word_str = QString::number(battery_status_.state.b.current, 10);                            //char型转qstring型
  ui.CurrentStatus->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.CurrentStatus->setPalette(color);

  //电池温度状态
  font.setPointSize(WORD_SIZE);
  ui.TempertureStatus->setFont(font);
  word_str = QString::number(battery_status_.state.b.temperature, 10);                            //char型转qstring型
  ui.TempertureStatus->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.TempertureStatus->setPalette(color);

  //电池异常状态
  font.setPointSize(WORD_SIZE);
  ui.ErrorStatus->setFont(font);
  word_str = QString::number(battery_status_.state.b.error, 10);                            //char型转qstring型
  ui.ErrorStatus->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.ErrorStatus->setPalette(color);

  //激活码状态
  font.setPointSize(WORD_SIZE);
  ui.ActiveStatus->setFont(font);
  word_str = QString::number(battery_status_.state.b.active, 10);                            //char型转qstring型
  ui.ActiveStatus->setText(QString(word_str));
  color.setColor(QPalette::WindowText,Qt::green);
  ui.ActiveStatus->setPalette(color);

  if(battery_status_.state.b.online == 1)
  {
      ui.OnlineStatusBtn->setIcon(QIcon(":/image/stured.png"));
  }
  else
  {
      ui.OnlineStatusBtn->setIcon(QIcon(":/image/stugreen.png"));
  }

  if(battery_status_.state.b.powerLow == 1)
  {
      ui.LowPowerStatusBtn->setIcon(QIcon(":/image/stured.png"));
  }
  else
  {
      ui.LowPowerStatusBtn->setIcon(QIcon(":/image/stugreen.png"));
  }

  if(battery_status_.state.b.charging == 1)
  {
      ui.ChargeStatusBtn->setIcon(QIcon(":/image/stured.png"));
  }
  else
  {
      ui.ChargeStatusBtn->setIcon(QIcon(":/image/stugreen.png"));
  }

  if(battery_status_.state.b.voltage == 1)
  {
      ui.VoltageStatusBtn->setIcon(QIcon(":/image/stured.png"));
  }
  else
  {
      ui.VoltageStatusBtn->setIcon(QIcon(":/image/stugreen.png"));
  }

  if(battery_status_.state.b.current == 1)
  {
      ui.CurrentStatusBtn->setIcon(QIcon(":/image/stured.png"));
  }
  else
  {
      ui.CurrentStatusBtn->setIcon(QIcon(":/image/stugreen.png"));
  }

  if(battery_status_.state.b.temperature == 1)
  {
      ui.TempertureStatusBtn->setIcon(QIcon(":/image/stured.png"));
  }
  else
  {
      ui.TempertureStatusBtn->setIcon(QIcon(":/image/stugreen.png"));
  }

  if(battery_status_.state.b.error == 1)
  {
      ui.ErrorStatusBtn->setIcon(QIcon(":/image/stured.png"));
  }
  else
  {
      ui.ErrorStatusBtn->setIcon(QIcon(":/image/stugreen.png"));
  }

  if(battery_status_.state.b.active == 1)
  {
      ui.ActiveStatusBtn->setIcon(QIcon(":/image/stured.png"));
  }
  else
  {
      ui.ActiveStatusBtn->setIcon(QIcon(":/image/stugreen.png"));
  }

  if(battery_status_.errorCode != 0)
  {
      ui.ErrorCodeBtn->setIcon(QIcon(":/image/stured.png"));
  }
  else
  {
      ui.ErrorCodeBtn->setIcon(QIcon(":/image/stugreen.png"));
  }
}

//电机信息界面显示
void MainWindow::MotorParaChange()
{
  if(CarTypeStatus == 1 || CarTypeStatus == 2)
  {
    //Motor_re_.serialNum == 1

      QString word_str;
      QPalette color;
      QFont font;

      //编号
      font.setPointSize(WORD_SIZE);
      ui.SeriaNum1->setFont(font);
      word_str = QString::number(Motor_re[0].serialNum, 10);
      ui.SeriaNum1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.SeriaNum1->setPalette(color);

      //OdometerRun
      font.setPointSize(WORD_SIZE);
      ui.Odometer1->setFont(font);
      word_str = QString::number(Motor_re[0].data, 10);
      ui.Odometer1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer1->setPalette(color);

      //ErrorRun
      font.setPointSize(WORD_SIZE);
      ui.Error1->setFont(font);
      word_str = QString::number(Motor_re[0].errorCode, 10);
      ui.Error1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error1->setPalette(color);

      //CountRun
      font.setPointSize(WORD_SIZE);
      ui.Count1->setFont(font);
      word_str = QString::number(Motor_re[0].count, 10);
      ui.Count1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count1->setPalette(color);

      /********************************************/
      //OnlineStatusRun
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus1->setFont(font);
      word_str = QString::number(Motor_re[0].state.b.online, 10);
      ui.OnlineStatus1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus1->setPalette(color);

      //ErrorStatusRun
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus1->setFont(font);
      word_str = QString::number(Motor_re[0].state.b.error, 10);
      ui.ErrorStatus1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus1->setPalette(color);

      //ErrorConStatus1
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus1->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit0_motor1Status, 10);
      ui.ErrorConStatus1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus1->setPalette(color);

    //Motor_re_.serialNum == 2

      //编号
      font.setPointSize(WORD_SIZE);
      ui.SeriaNum2->setFont(font);
      word_str = QString::number(Motor_re[1].serialNum, 10);
      ui.SeriaNum2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.SeriaNum2->setPalette(color);

      //AngleRotate
      font.setPointSize(WORD_SIZE);
      ui.Odometer2->setFont(font);
      word_str = QString::number(Motor_re[1].data, 10);
      ui.Odometer2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer2->setPalette(color);

      //ErrorRotate
      font.setPointSize(WORD_SIZE);
      ui.Error2->setFont(font);
      word_str = QString::number(Motor_re[1].errorCode, 10);
      ui.Error2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error2->setPalette(color);

      //CountRotate
      font.setPointSize(WORD_SIZE);
      ui.Count2->setFont(font);
      word_str = QString::number(Motor_re[1].count, 10);
      ui.Count2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count2->setPalette(color);

      /********************************************/
      //OnlineStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus2->setFont(font);
      word_str = QString::number(Motor_re[1].state.b.online, 10);
      ui.OnlineStatus2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus2->setPalette(color);

      //ErrorStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus2->setFont(font);
      word_str = QString::number(Motor_re[1].state.b.error, 10);
      ui.ErrorStatus2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus2->setPalette(color);

      //ErrorConStatus
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus2->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit1_motor2Status, 10);
      ui.ErrorConStatus2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus2->setPalette(color);


    //Motor_re_.serialNum == 3

      //编号
      font.setPointSize(WORD_SIZE);
      ui.SeriaNum3->setFont(font);
      word_str = QString::number(Motor_re[2].serialNum, 10);
      ui.SeriaNum3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.SeriaNum3->setPalette(color);

      //HydraulicPressure
      font.setPointSize(WORD_SIZE);
      ui.Odometer3->setFont(font);
      word_str = QString::number(Motor_re[2].data, 10);
      ui.Odometer3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer3->setPalette(color);

      //ErrorHydraulic
      font.setPointSize(WORD_SIZE);
      ui.Error3->setFont(font);
      word_str = QString::number(Motor_re[2].errorCode, 10);
      ui.Error3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error3->setPalette(color);

      //CountHydraulic
      font.setPointSize(WORD_SIZE);
      ui.Count3->setFont(font);
      word_str = QString::number(Motor_re[2].count, 10);
      ui.Count3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count3->setPalette(color);

      /********************************************/
      //OnlineStatusHydraulic
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus3->setFont(font);
      word_str = QString::number(Motor_re[2].state.b.online, 10);
      ui.OnlineStatus3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus3->setPalette(color);

      //ErrorStatusHydraulic
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus3->setFont(font);
      word_str = QString::number(Motor_re[2].state.b.error, 10);
      ui.ErrorStatus3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus3->setPalette(color);

      //ErrorConStatus
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus3->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit2_motor3Status, 10);
      ui.ErrorConStatus3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus3->setPalette(color);



//      if(CarTypeStatus == 1)
//      {
//        QImage img(":/image/4dai/robotmotor.png");
//        QImage scalimg = img.scaled(ui.RobotTypeImage->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
//        ui.RobotTypeImage->setPixmap(QPixmap::fromImage(scalimg));

//        //Motor_re_.serialNum == 4

//        //编号
//        font.setPointSize(WORD_SIZE);
//        ui.SeriaNum4->setFont(font);
//        word_str = QString::number(Motor_re[3].serialNum, 10);
//        ui.SeriaNum4->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.SeriaNum4->setPalette(color);

//        //HydraulicPressure
//        font.setPointSize(WORD_SIZE);
//        ui.Odometer4->setFont(font);
//        word_str = QString::number(Motor_re[3].data, 10);
//        ui.Odometer4->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.Odometer4->setPalette(color);

//        //ErrorHydraulic
//        font.setPointSize(WORD_SIZE);
//        ui.Error4->setFont(font);
//        word_str = QString::number(Motor_re[3].errorCode, 10);
//        ui.Error4->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.Error4->setPalette(color);

//        //CountHydraulic
//        font.setPointSize(WORD_SIZE);
//        ui.Count4->setFont(font);
//        word_str = QString::number(Motor_re[3].count, 10);
//        ui.Count4->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.Count4->setPalette(color);

//        /********************************************/
//        //OnlineStatusHydraulic
//        font.setPointSize(WORD_SIZE);
//        ui.OnlineStatus4->setFont(font);
//        word_str = QString::number(Motor_re[3].state.b.online, 10);
//        ui.OnlineStatus4->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.OnlineStatus4->setPalette(color);

//        //ErrorStatusHydraulic
//        font.setPointSize(WORD_SIZE);
//        ui.ErrorStatus4->setFont(font);
//        word_str = QString::number(Motor_re[3].state.b.error, 10);
//        ui.ErrorStatus4->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.ErrorStatus4->setPalette(color);

//        //ErrorConStatus
//        font.setPointSize(WORD_SIZE);
//        ui.ErrorConStatus4->setFont(font);
//        word_str = QString::number(IO_motor_.ch.bit3_motor4Status, 10);
//        ui.ErrorConStatus4->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.ErrorConStatus4->setPalette(color);

//        //Motor_re_.serialNum == 5
//        //编号
//        font.setPointSize(WORD_SIZE);
//        ui.SeriaNum5->setFont(font);
//        word_str = QString::number(Motor_re[4].serialNum, 10);
//        ui.SeriaNum5->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.SeriaNum5->setPalette(color);

//        //HydraulicPressure
//        font.setPointSize(WORD_SIZE);
//        ui.Odometer5->setFont(font);
//        word_str = QString::number(Motor_re[4].data, 10);
//        ui.Odometer5->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.Odometer5->setPalette(color);

//        //ErrorHydraulic
//        font.setPointSize(WORD_SIZE);
//        ui.Error5->setFont(font);
//        word_str = QString::number(Motor_re[4].errorCode, 10);
//        ui.Error5->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.Error5->setPalette(color);

//        //CountHydraulic
//        font.setPointSize(WORD_SIZE);
//        ui.Count5->setFont(font);
//        word_str = QString::number(Motor_re[4].count, 10);
//        ui.Count5->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.Count5->setPalette(color);

//        /********************************************/
//        //OnlineStatusHydraulic
//        font.setPointSize(WORD_SIZE);
//        ui.OnlineStatus5->setFont(font);
//        word_str = QString::number(Motor_re[4].state.b.online, 10);
//        ui.OnlineStatus5->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.OnlineStatus5->setPalette(color);

//        //ErrorStatusHydraulic
//        font.setPointSize(WORD_SIZE);
//        ui.ErrorStatus5->setFont(font);
//        word_str = QString::number(Motor_re[4].state.b.error, 10);
//        ui.ErrorStatus5->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.ErrorStatus5->setPalette(color);

//        //ErrorConStatus
//        font.setPointSize(WORD_SIZE);
//        ui.ErrorConStatus5->setFont(font);
//        word_str = QString::number(IO_motor_.ch.bit4_motor5Status, 10);
//        ui.ErrorConStatus5->setText(QString(word_str));
//        color.setColor(QPalette::WindowText,Qt::green);
//        ui.ErrorConStatus5->setPalette(color);

//        if(motorNumMode == 1)
//        {
//          //Motor_re_.serialNum == 6
//          //编号
//          font.setPointSize(WORD_SIZE);
//          ui.SeriaNum6->setFont(font);
//          word_str = QString::number(Motor_re[5].serialNum, 10);
//          ui.SeriaNum6->setText(QString(word_str));
//          color.setColor(QPalette::WindowText,Qt::green);
//          ui.SeriaNum6->setPalette(color);

//          //HydraulicPressure
//          font.setPointSize(WORD_SIZE);
//          ui.Odometer6->setFont(font);
//          word_str = QString::number(Motor_re[5].data, 10);
//          ui.Odometer6->setText(QString(word_str));
//          color.setColor(QPalette::WindowText,Qt::green);
//          ui.Odometer6->setPalette(color);

//          //ErrorHydraulic
//          font.setPointSize(WORD_SIZE);
//          ui.Error6->setFont(font);
//          word_str = QString::number(Motor_re[5].errorCode, 10);
//          ui.Error6->setText(QString(word_str));
//          color.setColor(QPalette::WindowText,Qt::green);
//          ui.Error6->setPalette(color);

//          //CountHydraulic
//          font.setPointSize(WORD_SIZE);
//          ui.Count6->setFont(font);
//          word_str = QString::number(Motor_re[5].count, 10);
//          ui.Count6->setText(QString(word_str));
//          color.setColor(QPalette::WindowText,Qt::green);
//          ui.Count6->setPalette(color);

//          /********************************************/
//          //OnlineStatusHydraulic
//          font.setPointSize(WORD_SIZE);
//          ui.OnlineStatus6->setFont(font);
//          word_str = QString::number(Motor_re[5].state.b.online, 10);
//          ui.OnlineStatus6->setText(QString(word_str));
//          color.setColor(QPalette::WindowText,Qt::green);
//          ui.OnlineStatus6->setPalette(color);

//          //ErrorStatusHydraulic
//          font.setPointSize(WORD_SIZE);
//          ui.ErrorStatus6->setFont(font);
//          word_str = QString::number(Motor_re[5].state.b.error, 10);
//          ui.ErrorStatus6->setText(QString(word_str));
//          color.setColor(QPalette::WindowText,Qt::green);
//          ui.ErrorStatus6->setPalette(color);

//          //ErrorConStatus
//          font.setPointSize(WORD_SIZE);
//          ui.ErrorConStatus6->setFont(font);
//          word_str = QString::number(IO_motor_.ch.bit5_motor6Status, 10);
//          ui.ErrorConStatus6->setText(QString(word_str));
//          color.setColor(QPalette::WindowText,Qt::green);
//          ui.ErrorConStatus6->setPalette(color);
//        }
//        else
//        {
//          ui.Motor6_num->hide();
//          ui.Motor6_speed->hide();
//          ui.Motor6_comm->hide();
//          ui.Motor6_errorcount->hide();
//          ui.Motor6_online->hide();
//          ui.Motor6_errornum->hide();
//          ui.Motor6_errorstatus->hide();

//          ui.SeriaNum6->hide();
//          ui.Odometer6->hide();
//          ui.Error6->hide();
//          ui.Count6->hide();
//          ui.OnlineStatus6->hide();
//          ui.ErrorStatus6->hide();
//          ui.ErrorConStatus6->hide();
//        }

//      }
     if(CarTypeStatus == 2)
      {
        //Motor_re_.serialNum == 4

        //编号
        font.setPointSize(WORD_SIZE);
        ui.SeriaNum4->setFont(font);
        word_str = QString::number(Motor_re[3].serialNum, 10);
        ui.SeriaNum4->setText(QString(word_str));
        color.setColor(QPalette::WindowText,Qt::green);
        ui.SeriaNum4->setPalette(color);

        //HydraulicPressure
        font.setPointSize(WORD_SIZE);
        ui.Odometer4->setFont(font);
        word_str = QString::number(Motor_re[3].data, 10);
        ui.Odometer4->setText(QString(word_str));
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Odometer4->setPalette(color);

        //ErrorHydraulic
        font.setPointSize(WORD_SIZE);
        ui.Error4->setFont(font);
        word_str = QString::number(Motor_re[3].errorCode, 10);
        ui.Error4->setText(QString(word_str));
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Error4->setPalette(color);

        //CountHydraulic
        font.setPointSize(WORD_SIZE);
        ui.Count4->setFont(font);
        word_str = QString::number(Motor_re[3].count, 10);
        ui.Count4->setText(QString(word_str));
        color.setColor(QPalette::WindowText,Qt::green);
        ui.Count4->setPalette(color);

        /********************************************/
        //OnlineStatusHydraulic
        font.setPointSize(WORD_SIZE);
        ui.OnlineStatus4->setFont(font);
        word_str = QString::number(Motor_re[3].state.b.online, 10);
        ui.OnlineStatus4->setText(QString(word_str));
        color.setColor(QPalette::WindowText,Qt::green);
        ui.OnlineStatus4->setPalette(color);

        //ErrorStatusHydraulic
        font.setPointSize(WORD_SIZE);
        ui.ErrorStatus4->setFont(font);
        word_str = QString::number(Motor_re[3].state.b.error, 10);
        ui.ErrorStatus4->setText(QString(word_str));
        color.setColor(QPalette::WindowText,Qt::green);
        ui.ErrorStatus4->setPalette(color);

        //ErrorConStatus
        font.setPointSize(WORD_SIZE);
        ui.ErrorConStatus4->setFont(font);
        word_str = QString::number(IO_motor_.ch.bit3_motor4Status, 10);
        ui.ErrorConStatus4->setText(QString(word_str));
        color.setColor(QPalette::WindowText,Qt::green);
        ui.ErrorConStatus4->setPalette(color);

        ui.Motor5_num->hide();
        ui.Motor5_speed->hide();
        ui.Motor5_comm->hide();
        ui.Motor5_errorcount->hide();
        ui.Motor5_online->hide();
        ui.Motor5_errornum->hide();
        ui.Motor5_errorstatus->hide();

        ui.SeriaNum5->hide();
        ui.Odometer5->hide();
        ui.Error5->hide();
        ui.Count5->hide();
        ui.OnlineStatus5->hide();
        ui.ErrorStatus5->hide();
        ui.ErrorConStatus5->hide();
      }
  }
  else if(CarTypeStatus == 3)
  {
    //Motor_re_.serialNum == 1

      QString word_str;
      QPalette color;
      QFont font;

  //    //编号
  //    font.setPointSize(WORD_SIZE);
  //    ui.SeriaNum1->setFont(font);
  //    word_str = QString::number(Motor_re[0].serialNum, 10);
  //    ui.SeriaNum1->setText(QString(word_str));
  //    color.setColor(QPalette::WindowText,Qt::green);
  //    ui.SeriaNum1->setPalette(color);

      //OdometerRun
      font.setPointSize(WORD_SIZE);
      ui.Odometer1_Semi->setFont(font);
      word_str = QString::number(Motor_re[0].data, 10);
      ui.Odometer1_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer1_Semi->setPalette(color);

      //ErrorRun
      font.setPointSize(WORD_SIZE);
      ui.Error1_Semi->setFont(font);
      word_str = QString::number(Motor_re[0].errorCode, 10);
      ui.Error1_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error1_Semi->setPalette(color);

      //CountRun
      font.setPointSize(WORD_SIZE);
      ui.Count1_Semi->setFont(font);
      word_str = QString::number(Motor_re[0].count, 10);
      ui.Count1_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count1_Semi->setPalette(color);

      /********************************************/
      //OnlineStatusRun
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus1_Semi->setFont(font);
      word_str = QString::number(Motor_re[0].state.b.online, 10);
      ui.OnlineStatus1_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus1_Semi->setPalette(color);

      //ErrorStatusRun
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus1_Semi->setFont(font);
      word_str = QString::number(Motor_re[0].state.b.error, 10);
      ui.ErrorStatus1_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus1_Semi->setPalette(color);

      //ErrorConStatus1
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus1_Semi->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit0_motor1Status, 10);
      ui.ErrorConStatus1_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus1_Semi->setPalette(color);

    //Motor_re_.serialNum == 2

      //编号
  //    font.setPointSize(WORD_SIZE);
  //    ui.SeriaNum2->setFont(font);
  //    word_str = QString::number(Motor_re[1].serialNum, 10);
  //    ui.SeriaNum2->setText(QString(word_str));
  //    color.setColor(QPalette::WindowText,Qt::green);
  //    ui.SeriaNum2->setPalette(color);

      //AngleRotate
      font.setPointSize(WORD_SIZE);
      ui.Odometer2_Semi->setFont(font);
      word_str = QString::number(Motor_re[1].data, 10);
      ui.Odometer2_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer2_Semi->setPalette(color);

      //ErrorRotate
      font.setPointSize(WORD_SIZE);
      ui.Error2_Semi->setFont(font);
      word_str = QString::number(Motor_re[1].errorCode, 10);
      ui.Error2_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error2_Semi->setPalette(color);

      //CountRotate
      font.setPointSize(WORD_SIZE);
      ui.Count2_Semi->setFont(font);
      word_str = QString::number(Motor_re[1].count, 10);
      ui.Count2_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count2_Semi->setPalette(color);

      /********************************************/
      //OnlineStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus2_Semi->setFont(font);
      word_str = QString::number(Motor_re[1].state.b.online, 10);
      ui.OnlineStatus2_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus2_Semi->setPalette(color);

      //ErrorStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus2_Semi->setFont(font);
      word_str = QString::number(Motor_re[1].state.b.error, 10);
      ui.ErrorStatus2_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus2_Semi->setPalette(color);

      //ErrorConStatus
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus2_Semi->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit1_motor2Status, 10);
      ui.ErrorConStatus2_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus2_Semi->setPalette(color);

    //Motor_re_.serialNum == 3

      //编号
  //    font.setPointSize(WORD_SIZE);
  //    ui.SeriaNum3->setFont(font);
  //    word_str = QString::number(Motor_re[1].serialNum, 10);
  //    ui.SeriaNum4->setText(QString(word_str));
  //    color.setColor(QPalette::WindowText,Qt::green);
  //    ui.SeriaNum3->setPalette(color);

      //AngleRotate
      font.setPointSize(WORD_SIZE);
      ui.Odometer3_Semi->setFont(font);
      word_str = QString::number(Motor_re[2].data, 10);
      ui.Odometer3_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer3_Semi->setPalette(color);

      //ErrorRotate
      font.setPointSize(WORD_SIZE);
      ui.Error3_Semi->setFont(font);
      word_str = QString::number(Motor_re[2].errorCode, 10);
      ui.Error3_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error3_Semi->setPalette(color);

      //CountRotate
      font.setPointSize(WORD_SIZE);
      ui.Count3_Semi->setFont(font);
      word_str = QString::number(Motor_re[2].count, 10);
      ui.Count3_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count3_Semi->setPalette(color);

      /********************************************/
      //OnlineStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus3_Semi->setFont(font);
      word_str = QString::number(Motor_re[2].state.b.online, 10);
      ui.OnlineStatus3_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus3_Semi->setPalette(color);

      //ErrorStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus3_Semi->setFont(font);
      word_str = QString::number(Motor_re[2].state.b.error, 10);
      ui.ErrorStatus3_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus3_Semi->setPalette(color);

      //ErrorConStatus
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus3_Semi->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit2_motor3Status, 10);
      ui.ErrorConStatus3_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus3_Semi->setPalette(color);

    //Motor_re_.serialNum == 4

      //编号
    //    font.setPointSize(WORD_SIZE);
    //    ui.SeriaNum2->setFont(font);
    //    word_str = QString::number(Motor_re[1].serialNum, 10);
    //    ui.SeriaNum2->setText(QString(word_str));
    //    color.setColor(QPalette::WindowText,Qt::green);
    //    ui.SeriaNum2->setPalette(color);

      //AngleRotate
      font.setPointSize(WORD_SIZE);
      ui.Odometer4_Semi->setFont(font);
      word_str = QString::number(Motor_re[3].data, 10);
      ui.Odometer4_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer4_Semi->setPalette(color);

      //ErrorRotate
      font.setPointSize(WORD_SIZE);
      ui.Error4_Semi->setFont(font);
      word_str = QString::number(Motor_re[3].errorCode, 10);
      ui.Error4_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error4_Semi->setPalette(color);

      //CountRotate
      font.setPointSize(WORD_SIZE);
      ui.Count4_Semi->setFont(font);
      word_str = QString::number(Motor_re[3].count, 10);
      ui.Count4_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count4_Semi->setPalette(color);

      /********************************************/
      //OnlineStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus4_Semi->setFont(font);
      word_str = QString::number(Motor_re[3].state.b.online, 10);
      ui.OnlineStatus4_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus4_Semi->setPalette(color);

      //ErrorStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus4_Semi->setFont(font);
      word_str = QString::number(Motor_re[3].state.b.error, 10);
      ui.ErrorStatus4_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus4_Semi->setPalette(color);

      //ErrorConStatus
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus4_Semi->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit3_motor4Status, 10);
      ui.ErrorConStatus4_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus4_Semi->setPalette(color);

    //Motor_re_.serialNum == 5

      //编号
  //    font.setPointSize(WORD_SIZE);
  //    ui.SeriaNum5->setFont(font);
  //    word_str = QString::number(Motor_re[1].serialNum, 10);
  //    ui.SeriaNum5->setText(QString(word_str));
  //    color.setColor(QPalette::WindowText,Qt::green);
  //    ui.SeriaNum5->setPalette(color);

      //AngleRotate
      font.setPointSize(WORD_SIZE);
      ui.Odometer5_Semi->setFont(font);
      word_str = QString::number(Motor_re[4].data, 10);
      ui.Odometer5_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer5_Semi->setPalette(color);

      //ErrorRotate
      font.setPointSize(WORD_SIZE);
      ui.Error5_Semi->setFont(font);
      word_str = QString::number(Motor_re[4].errorCode, 10);
      ui.Error5_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error5_Semi->setPalette(color);

      //CountRotate
      font.setPointSize(WORD_SIZE);
      ui.Count5_Semi->setFont(font);
      word_str = QString::number(Motor_re[4].count, 10);
      ui.Count5_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count5_Semi->setPalette(color);

      /********************************************/
      //OnlineStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus5_Semi->setFont(font);
      word_str = QString::number(Motor_re[4].state.b.online, 10);
      ui.OnlineStatus5_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus5_Semi->setPalette(color);

      //ErrorStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus5_Semi->setFont(font);
      word_str = QString::number(Motor_re[4].state.b.error, 10);
      ui.ErrorStatus5_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus5_Semi->setPalette(color);

      //ErrorConStatus
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus5_Semi->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit4_motor5Status, 10);
      ui.ErrorConStatus5_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus5_Semi->setPalette(color);

    //Motor_re_.serialNum == 6

      //编号
  //    font.setPointSize(WORD_SIZE);
  //    ui.SeriaNum6->setFont(font);
  //    word_str = QString::number(Motor_re[1].serialNum, 10);
  //    ui.SeriaNum6->setText(QString(word_str));
  //    color.setColor(QPalette::WindowText,Qt::green);
  //    ui.SeriaNum6->setPalette(color);

      //AngleRotate
      font.setPointSize(WORD_SIZE);
      ui.Odometer6_Semi->setFont(font);
      word_str = QString::number(Motor_re[5].data, 10);
      ui.Odometer6_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer6_Semi->setPalette(color);

      //ErrorRotate
      font.setPointSize(WORD_SIZE);
      ui.Error6_Semi->setFont(font);
      word_str = QString::number(Motor_re[5].errorCode, 10);
      ui.Error6_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error6_Semi->setPalette(color);

      //CountRotate
      font.setPointSize(WORD_SIZE);
      ui.Count6_Semi->setFont(font);
      word_str = QString::number(Motor_re[5].count, 10);
      ui.Count6_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count6_Semi->setPalette(color);

      /********************************************/
      //OnlineStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus6_Semi->setFont(font);
      word_str = QString::number(Motor_re[5].state.b.online, 10);
      ui.OnlineStatus6_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus6_Semi->setPalette(color);

      //ErrorStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus6_Semi->setFont(font);
      word_str = QString::number(Motor_re[5].state.b.error, 10);
      ui.ErrorStatus6_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus6_Semi->setPalette(color);

      //ErrorConStatus
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus6_Semi->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit5_motor6Status, 10);
      ui.ErrorConStatus6_Semi->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus6_Semi->setPalette(color);
  }
  else if(CarTypeStatus == 4 || CarTypeStatus == 5)
  {
    if(CarTypeStatus == 4)
    {
      QImage img(":/image/chache/chache2.png");
      QImage scalimg = img.scaled(ui.RobotTypeImage->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
      ui.RobotTypeImage->setPixmap(QPixmap::fromImage(scalimg));
    }
    else if(CarTypeStatus == 5)
    {
      QImage img(":/image/smallred.png");
      QImage scalimg = img.scaled(ui.RobotTypeImage->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
      ui.RobotTypeImage->setPixmap(QPixmap::fromImage(scalimg));
    }


    //Motor_re_.serialNum == 1

      QString word_str;
      QPalette color;
      QFont font;

      //编号
      font.setPointSize(WORD_SIZE);
      ui.Motor1_num->setFont(font);
      word_str = QString::fromLocal8Bit("行走电机");
      ui.Motor1_num->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Motor1_num->setPalette(color);

      font.setPointSize(WORD_SIZE);
      ui.SeriaNum1->setFont(font);
      word_str = QString::number(Motor_re[0].serialNum, 10);
      ui.SeriaNum1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.SeriaNum1->setPalette(color);

      //OdometerRun
      font.setPointSize(WORD_SIZE);
      ui.Odometer1->setFont(font);
      word_str = QString::number(Motor_re[0].data, 10);
      ui.Odometer1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer1->setPalette(color);

      //ErrorRun
      font.setPointSize(WORD_SIZE);
      ui.Error1->setFont(font);
      word_str = QString::number(Motor_re[0].errorCode, 10);
      ui.Error1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error1->setPalette(color);

      //CountRun
      font.setPointSize(WORD_SIZE);
      ui.Count1->setFont(font);
      word_str = QString::number(Motor_re[0].count, 10);
      ui.Count1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count1->setPalette(color);

      /********************************************/
      //OnlineStatusRun
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus1->setFont(font);
      word_str = QString::number(Motor_re[0].state.b.online, 10);
      ui.OnlineStatus1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus1->setPalette(color);

      //ErrorStatusRun
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus1->setFont(font);
      word_str = QString::number(Motor_re[0].state.b.error, 10);
      ui.ErrorStatus1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus1->setPalette(color);

      //ErrorConStatus1
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus1->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit0_motor1Status, 10);
      ui.ErrorConStatus1->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus1->setPalette(color);

    //Motor_re_.serialNum == 2

      //编号
      font.setPointSize(WORD_SIZE);
      ui.Motor2_num->setFont(font);
      word_str = QString::fromLocal8Bit("旋转电机");
      ui.Motor2_num->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Motor2_num->setPalette(color);

      font.setPointSize(WORD_SIZE);
      ui.SeriaNum2->setFont(font);
      word_str = QString::number(Motor_re[1].serialNum, 10);
      ui.SeriaNum2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.SeriaNum2->setPalette(color);

      //AngleRotate
      font.setPointSize(WORD_SIZE);
      ui.Odometer2->setFont(font);
      word_str = QString::number(Motor_re[1].data, 10);
      ui.Odometer2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer2->setPalette(color);

      //ErrorRotate
      font.setPointSize(WORD_SIZE);
      ui.Error2->setFont(font);
      word_str = QString::number(Motor_re[1].errorCode, 10);
      ui.Error2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error2->setPalette(color);

      //CountRotate
      font.setPointSize(WORD_SIZE);
      ui.Count2->setFont(font);
      word_str = QString::number(Motor_re[1].count, 10);
      ui.Count2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count2->setPalette(color);

      /********************************************/
      //OnlineStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus2->setFont(font);
      word_str = QString::number(Motor_re[1].state.b.online, 10);
      ui.OnlineStatus2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus2->setPalette(color);

      //ErrorStatusRotate
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus2->setFont(font);
      word_str = QString::number(Motor_re[1].state.b.error, 10);
      ui.ErrorStatus2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus2->setPalette(color);

      //ErrorConStatus
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus2->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit1_motor2Status, 10);
      ui.ErrorConStatus2->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus2->setPalette(color);


    //Motor_re_.serialNum == 3

      //编号
      font.setPointSize(WORD_SIZE);
      ui.Motor3_num->setFont(font);
      word_str = QString::fromLocal8Bit("液压电机");
      ui.Motor3_num->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Motor3_num->setPalette(color);

      font.setPointSize(WORD_SIZE);
      ui.SeriaNum3->setFont(font);
      word_str = QString::number(Motor_re[2].serialNum, 10);
      ui.SeriaNum3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.SeriaNum3->setPalette(color);

      //HydraulicPressure
      font.setPointSize(WORD_SIZE);
      ui.Odometer3->setFont(font);
      word_str = QString::number(Motor_re[2].data, 10);
      ui.Odometer3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Odometer3->setPalette(color);

      //ErrorHydraulic
      font.setPointSize(WORD_SIZE);
      ui.Error3->setFont(font);
      word_str = QString::number(Motor_re[2].errorCode, 10);
      ui.Error3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Error3->setPalette(color);

      //CountHydraulic
      font.setPointSize(WORD_SIZE);
      ui.Count3->setFont(font);
      word_str = QString::number(Motor_re[2].count, 10);
      ui.Count3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.Count3->setPalette(color);

      /********************************************/
      //OnlineStatusHydraulic
      font.setPointSize(WORD_SIZE);
      ui.OnlineStatus3->setFont(font);
      word_str = QString::number(Motor_re[2].state.b.online, 10);
      ui.OnlineStatus3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.OnlineStatus3->setPalette(color);

      //ErrorStatusHydraulic
      font.setPointSize(WORD_SIZE);
      ui.ErrorStatus3->setFont(font);
      word_str = QString::number(Motor_re[2].state.b.error, 10);
      ui.ErrorStatus3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorStatus3->setPalette(color);

      //ErrorConStatus
      font.setPointSize(WORD_SIZE);
      ui.ErrorConStatus3->setFont(font);
      word_str = QString::number(IO_motor_.ch.bit2_motor3Status, 10);
      ui.ErrorConStatus3->setText(QString(word_str));
      color.setColor(QPalette::WindowText,Qt::green);
      ui.ErrorConStatus3->setPalette(color);

    ui.Motor4_num->hide();
    ui.Motor4_speed->hide();
    ui.Motor4_comm->hide();
    ui.Motor4_errorcount->hide();
    ui.Motor4_online->hide();
    ui.Motor4_errornum->hide();
    ui.Motor4_errorstatus->hide();

    ui.SeriaNum4->hide();
    ui.Odometer4->hide();
    ui.Error4->hide();
    ui.Count4->hide();
    ui.OnlineStatus4->hide();
    ui.ErrorStatus4->hide();
    ui.ErrorConStatus4->hide();

    ui.Motor5_num->hide();
    ui.Motor5_speed->hide();
    ui.Motor5_comm->hide();
    ui.Motor5_errorcount->hide();
    ui.Motor5_online->hide();
    ui.Motor5_errornum->hide();
    ui.Motor5_errorstatus->hide();

    ui.SeriaNum5->hide();
    ui.Odometer5->hide();
    ui.Error5->hide();
    ui.Count5->hide();
    ui.OnlineStatus5->hide();
    ui.ErrorStatus5->hide();
    ui.ErrorConStatus5->hide();

    ui.Motor6_num->hide();
    ui.Motor6_speed->hide();
    ui.Motor6_comm->hide();
    ui.Motor6_errorcount->hide();
    ui.Motor6_online->hide();
    ui.Motor6_errornum->hide();
    ui.Motor6_errorstatus->hide();

    ui.SeriaNum6->hide();
    ui.Odometer6->hide();
    ui.Error6->hide();
    ui.Count6->hide();
    ui.OnlineStatus6->hide();
    ui.ErrorStatus6->hide();
    ui.ErrorConStatus6->hide();
  }
}

//本机错误log
void MainWindow::errorLocalLogInfoDecode(QString alarminfo)
{
  QDateTime dateTime= QDateTime::currentDateTime();//获取系统当前的时间
  QString s = dateTime.toString("yyyy-MM-dd hh:mm:ss");

//        log_info_.info = "关闭成功";
//        log_info_.solution = "关闭成功";

  QString Enter1 = "\n";

  QString info = QString::fromLocal8Bit("报警信息:");
  QString info_detail = alarminfo;

  QString word_str1 = info + info_detail + Enter1;

  if(CreatLog == 0)
  {
    QString path1 = "/home/lk/log/download/screen_glog/Errorlog";
//    QString path1 = "/home/sjx/log/download/screen_glog/Errorlog";
//    QString path1 = "Errorlog";
    QString txt = ".txt";
    path = path1 + s + txt;

    CreatLog = 1;
  }

  QFile data(path);  //创建output.txt
  if(data.open(QFile::WriteOnly | QIODevice::Append))
  {  //以只写方式打开 | 删除之前打开的设备以建立新的连接
      QTextStream out(&data);
      out << s << word_str1;
      data.close();
  }

}

void MainWindow::LedScreenShow(uint8_t *word_txt)
{

//  QString word_s = QString::fromLocal8Bit("Q01YC013-XH07");
//    QString IP = QString::fromLocal8Bit("192.168.0.217");
  unsigned char ip[] = "192.168.60.10";
//    uint8_t *ip =  (unsigned char *)IP.data();
//    uint8_t *word_txt = (unsigned char *)word_s.data();

//  unsigned char word_txt[] = "表格左上角坐标(第一个单元格字体起点";
  uint32_t nport = 5005;
  uint8_t id = 1;
  uint8_t color = 2;
  uint8_t font = 10;
  uint8_t left_top_x = 0;
  uint8_t left_top_y = 8;
  uint8_t width = 64;
  uint8_t height = 16;

  agvInfoShowled(ip, nport, 2, color, font, id, left_top_x, left_top_y, width, height, word_txt);

   nport = 5005;
   id = 2;
   color = 2;
   font = 10;
   left_top_x = 0;
   left_top_y = 40;
   width = 64;
   height = 16;

   agvInfoShowled(ip, nport, 2, color, font, id, left_top_x, left_top_y, width, height, word_txt);
}

void MainWindow::GetParaFromJson()
{
//  QFile file("/home/sjx/magnet_new/src/gui/para/para.json");
  QFile file("/home/lk/auto_start/para.json");
//  QFile file("/home/sjx/auto_start/para.json");    //调试使用

  if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
  {
    qDebug() << "getparaJSON打开失败";
//    return 1;
  }

  QByteArray bytes = file.readAll();// 把文件中所有数据读取出来
  QJsonDocument doc = QJsonDocument::fromJson(bytes);// 将读出的数据保存为Json文档

  // 解析JSON数据
  QJsonParseError error;
//  QJsonDocument doc = QJsonDocument::fromJson(file.readAll(), &error);

  if (error.error != QJsonParseError::NoError)
  {
      qDebug() << "getpara-JSON解析错误:" << error.errorString();
//      return 1;
  }

  QJsonObject rootObj = doc.object();
  struct GetPara getpara;
  getpara.IPpb = rootObj.value("IPpb").toString();
  getpara.ServerIP = rootObj.value("ServerIP").toString();
  getpara.LedScreenIP = rootObj.value("LedScreenIP").toString();
  getpara.LedWord = rootObj.value("LedWord").toString();
  getpara.LedStatus = rootObj.value("LedStatus").toInt();
  getpara.CarTypeMode = rootObj.value("CarTypeMode").toInt();
  getpara.LedOpenCloseMode = rootObj.value("LedOpenCloseMode").toInt();
  getpara.PositionMode = rootObj.value("PositionMode").toInt();

  getIP = getpara.IPpb;
  getNetIP = getpara.ServerIP;
  ledScreenIP = getpara.LedScreenIP;
  ledWord = getpara.LedWord.toLocal8Bit().constData();     //文件中读取到的语句
  ledStatus = getpara.LedStatus;
  LedOpenCloseMode = getpara.LedOpenCloseMode;
  CarTypeMode = getpara.CarTypeMode;
  PositionMode = getpara.PositionMode;

//  qDebug() << "LedOpenCloseMode =" << CarTypeMode;


}

void MainWindow::GetParaFromJsonPosition()
{
//  QFile file("/home/sjx/magnet_new/src/gui/para/para.json");
  QFile file("/home/lk/auto_start/position.json");
//  QFile file("/home/sjx/auto_start/position.json");

  if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
  {
    qDebug() << "getparaJSON打开失败";
//    return 1;
  }

  QByteArray bytes = file.readAll();// 把文件中所有数据读取出来
  QJsonDocument doc = QJsonDocument::fromJson(bytes);// 将读出的数据保存为Json文档

  // 解析JSON数据
  QJsonParseError error;
//  QJsonDocument doc = QJsonDocument::fromJson(file.readAll(), &error);

  if (error.error != QJsonParseError::NoError)
  {
      qDebug() << "getpara-JSON解析错误:" << error.errorString();
//      return 1;
  }

  QJsonObject rootObj = doc.object();

  positon_point_coordinate[0][0] = rootObj.value("point1_x").toDouble();
  positon_point_coordinate[0][1] = rootObj.value("point1_y").toDouble();
  positon_point_coordinate[0][2] = rootObj.value("point1_angle").toDouble();

  positon_point_coordinate[1][0] = rootObj.value("point2_x").toDouble();
  positon_point_coordinate[1][1] = rootObj.value("point2_y").toDouble();
  positon_point_coordinate[1][2] = rootObj.value("point2_angle").toDouble();

  positon_point_coordinate[2][0] = rootObj.value("point3_x").toDouble();
  positon_point_coordinate[2][1] = rootObj.value("point3_y").toDouble();
  positon_point_coordinate[2][2] = rootObj.value("point3_angle").toDouble();

  positon_point_coordinate[3][0] = rootObj.value("point4_x").toDouble();
  positon_point_coordinate[3][1] = rootObj.value("point4_y").toDouble();
  positon_point_coordinate[3][2] = rootObj.value("point4_angle").toDouble();

  positon_point_coordinate[4][0] = rootObj.value("point5_x").toDouble();
  positon_point_coordinate[4][1] = rootObj.value("point5_y").toDouble();
  positon_point_coordinate[4][2] = rootObj.value("point5_angle").toDouble();

  positon_point_coordinate[5][0] = rootObj.value("point6_x").toDouble();
  positon_point_coordinate[5][1] = rootObj.value("point6_y").toDouble();
  positon_point_coordinate[5][2] = rootObj.value("point6_angle").toDouble();

  positon_point_coordinate[6][0] = rootObj.value("point7_x").toDouble();
  positon_point_coordinate[6][1] = rootObj.value("point7_y").toDouble();
  positon_point_coordinate[6][2] = rootObj.value("point7_angle").toDouble();

  positon_point_coordinate[7][0] = rootObj.value("point8_x").toDouble();
  positon_point_coordinate[7][1] = rootObj.value("point8_y").toDouble();
  positon_point_coordinate[7][2] = rootObj.value("point8_angle").toDouble();

  positon_point_coordinate[8][0] = rootObj.value("point9_x").toDouble();
  positon_point_coordinate[8][1] = rootObj.value("point9_y").toDouble();
  positon_point_coordinate[8][2] = rootObj.value("point9_angle").toDouble();

  positon_point_coordinate[9][0] = rootObj.value("point10_x").toDouble();
  positon_point_coordinate[9][1] = rootObj.value("point10_y").toDouble();
  positon_point_coordinate[9][2] = rootObj.value("point10_angle").toDouble();

  positon_point_coordinate[10][0] = rootObj.value("point11_x").toDouble();
  positon_point_coordinate[10][1] = rootObj.value("point11_y").toDouble();
  positon_point_coordinate[10][2] = rootObj.value("point11_angle").toDouble();

  qDebug() << "LedOpenCloseMode111111 =" << positon_point_coordinate[10][1];
}

void MainWindow::ledTask()
{
  //  QString word_s = QString::fromLocal8Bit(mission_info_.missionName.c_str());

//  QString word_s_start = "";
//    QString word_s_start = QString::fromLocal8Bit("GWXS01M101");
//    QString word_s_start = QString::fromLocal8Bit("GWHC21M103");
  //    QString word_s_start = QString::fromLocal8Bit("GWHC30M103");
  //  QString word_s_start = QString::fromLocal8Bit("GWLT01M102");
  //  QString word_s_stop = QString::fromLocal8Bit("GWXS01M101");
  //  QString word_s_stop = QString::fromLocal8Bit("GWHC07M103");
//    QString word_s_stop = QString::fromLocal8Bit("GWLT01M102");
//    QString word_s_stop = QString::fromLocal8Bit("GWHC35M103");

    QString word_s_start = QString::fromLocal8Bit(mission_info_.taskStartPoint.c_str());
    QString word_s_stop = QString::fromLocal8Bit(mission_info_.taskStopPoint.c_str());

    QString TASKINFO;
  //  QString FROM = QString::fromLocal8Bit("从");
    QString XSJT = QString::fromLocal8Bit("细纱");
    QString GT = QString::fromLocal8Bit("管桶");
    QString ST = QString::fromLocal8Bit("纱桶");
    QString SMLEFT = QString::fromLocal8Bit("左");
    QString SMRIGHT = QString::fromLocal8Bit("右");
    QString GOTO = QString::fromLocal8Bit("-");
    QString LTJT = QString::fromLocal8Bit("络筒");
    QString ZLGT = QString::fromLocal8Bit("自络管桶");
    QString ZLST = QString::fromLocal8Bit("自络纱筒");
    QString HCJT = QString::fromLocal8Bit("缓存");
    QString AREA = QString::fromLocal8Bit("区");
    QString GOTOFREE = QString::fromLocal8Bit("回空闲点");
    QString BCRW = QString::fromLocal8Bit("半程任务终点--");

    QString STARTPONIT;
    QString STOPPONIT;

    int index_xs = word_s_start.indexOf("XS");
    int index_hc = word_s_start.indexOf("HC");
    int index_lt = word_s_start.indexOf("LT");

    if(index_xs != -1)
    {
      for(int i=0; i<100; i++)
      {
        if(i<10)
        {
           QString sm = "XS0";
           QString num = QString::number(i, 10);
           QString sm_num = sm + num;
           int k = word_s_start.indexOf(sm_num);
           if(k != -1)
           {
             XSJT = XSJT + num;
           }
        }
        else
        {
          QString sm = "XS";
          QString num = QString::number(i, 10);
          QString sm_num = sm + num;
          int k = word_s_start.indexOf(sm_num);
          if(k != -1)
          {
            XSJT = XSJT + num;
          }
        }
      }
      STARTPONIT = XSJT;
    }
    else if(index_hc != -1)
    {

      int NUM_HC = word_s_start.mid(4,2).toInt();
      if(NUM_HC >= 2 && NUM_HC < 4)
      {
        QString NUM = QString::number(1, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 4 && NUM_HC < 9)
      {
        QString NUM = QString::number(2, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 9 && NUM_HC < 14)
      {
        QString NUM = QString::number(3, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 14 && NUM_HC < 16)
      {
        QString NUM = QString::number(4, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 16 && NUM_HC < 18)
      {
        QString NUM = QString::number(5, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 18 && NUM_HC < 23)
      {
        QString NUM = QString::number(6, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 23 && NUM_HC < 28)
      {
        QString NUM = QString::number(7, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 28 && NUM_HC < 30)
      {
        QString NUM = QString::number(8, 10);
        HCJT = XSJT + GT + NUM;
      }
      else
      {
        switch (NUM_HC)
        {
          case 30: NUM_HC = 1;
            break;
          case 31: NUM_HC = 2;
            break;
          case 32: NUM_HC = 3;
            break;
          case 33: NUM_HC = 4;
            break;
          case 34: NUM_HC = 5;
            break;
          case 35: NUM_HC = 6;
            break;
          case 36: NUM_HC = 7;
            break;
          case 37: NUM_HC = 8;
            break;
          case 38: NUM_HC = 9;
            break;
          default:
            break;
        }

          QString NUM = QString::number(NUM_HC, 10);
          HCJT = ZLGT + NUM;
      }

      STARTPONIT = HCJT;
    }
    else if(index_lt != -1)
    {
      for(int i=0; i<100; i++)
      {
        if(i<10)
        {
           QString sm = "LT0";
           QString num = QString::number(i, 10);
           QString sm_num = sm + num;
           int k = word_s_start.indexOf(sm_num);
           if(k != -1)
           {
             LTJT = ZLST + num;
           }
        }
        else
        {
          QString sm = "LT";
          QString num = QString::number(i, 10);
          QString sm_num = sm + num;
          int k = word_s_start.indexOf(sm_num);
          if(k != -1)
          {
            LTJT = LTJT + num;
          }
        }
      }
      STARTPONIT = LTJT;
    }
    else if(index_xs == -1 && index_hc == -1 && index_lt == -1)
    {
      STARTPONIT == BCRW;
    }

    int index_xs_stop = word_s_stop.indexOf("XS");
    int index_hc_stop = word_s_stop.indexOf("HC");
    int index_lt_stop = word_s_stop.indexOf("LT");

    if(index_xs_stop != -1)
    {
      for(int i=0; i<100; i++)
      {
        if(i<10)
        {
           QString sm = "XS0";
           QString num = QString::number(i, 10);
           QString sm_num = sm + num;
           int k = word_s_stop.indexOf(sm_num);
           if(k != -1)
           {
             XSJT = XSJT + num;
           }
        }
        else
        {
          QString sm = "XS";
          QString num = QString::number(i, 10);
          QString sm_num = sm + num;
          int k = word_s_stop.indexOf(sm_num);
          if(k != -1)
          {
            XSJT = XSJT + num;
          }
        }
      }
      STOPPONIT = XSJT;
    }
    else if(index_hc_stop != -1)
    {
      int NUM_HC = word_s_stop.mid(4,2).toInt();
      if(NUM_HC >= 2 && NUM_HC < 4)
      {
        QString NUM = QString::number(1, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 4 && NUM_HC < 9)
      {
        QString NUM = QString::number(2, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 9 && NUM_HC < 14)
      {
        QString NUM = QString::number(3, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 14 && NUM_HC < 16)
      {
        QString NUM = QString::number(4, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 16 && NUM_HC < 18)
      {
        QString NUM = QString::number(5, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 18 && NUM_HC < 23)
      {
        QString NUM = QString::number(6, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 23 && NUM_HC < 28)
      {
        QString NUM = QString::number(7, 10);
        HCJT = XSJT + GT + NUM;
      }
      else if(NUM_HC >= 28 && NUM_HC < 30)
      {
        QString NUM = QString::number(8, 10);
        HCJT = XSJT + GT + NUM;
      }
      else
      {
        switch (NUM_HC)
        {
          case 30: NUM_HC = 1;
            break;
          case 31: NUM_HC = 2;
            break;
          case 32: NUM_HC = 3;
            break;
          case 33: NUM_HC = 4;
            break;
          case 34: NUM_HC = 5;
            break;
          case 35: NUM_HC = 6;
            break;
          case 36: NUM_HC = 7;
            break;
          case 37: NUM_HC = 8;
            break;
          case 38: NUM_HC = 9;
            break;
          default:
            break;
        }

        QString NUM = QString::number(NUM_HC, 10);
        HCJT = ZLGT + NUM;
      }
      STOPPONIT = HCJT;
    }
    else if(index_lt_stop != -1)
    {
      for(int i=0; i<100; i++)
      {
        if(i<10)
        {
           QString sm = "LT0";
           QString num = QString::number(i, 10);
           QString sm_num = sm + num;
           int k = word_s_stop.indexOf(sm_num);
           if(k != -1)
           {
             LTJT = ZLST + num;
           }
        }
        else
        {
          QString sm = "LT";
          QString num = QString::number(i, 10);
          QString sm_num = sm + num;
          int k = word_s_stop.indexOf(sm_num);
          if(k != -1)
          {
            LTJT = LTJT + num;
          }
        }
      }
      STOPPONIT = LTJT;
    }

    QString FRONTNUM = word_s_start.mid(8, 2);
    QString BACKNUM = word_s_stop.mid(8, 2);
    QString LTFRONTNUM = word_s_start.mid(8, 2);
    QString LTBACKNUM = word_s_stop.mid(8, 2);

    //XS-hc  xs-lt  hc-lt hc-xs lt-hc lt-xs

    if(index_xs != -1 && index_hc_stop != -1)
    {
      TASKINFO = STARTPONIT + GOTO + STOPPONIT + AREA + BACKNUM;
    }
    else if(index_xs != -1 && index_lt_stop != -1)
    {
      TASKINFO = STARTPONIT + GOTO + STOPPONIT + AREA + LTBACKNUM;
    }
    else if(index_hc != -1 && index_xs_stop != -1)
    {
      TASKINFO = STARTPONIT + AREA + FRONTNUM + GOTO + STOPPONIT;
    }
    else if(index_hc != -1 && index_lt_stop != -1)
    {
      TASKINFO = STARTPONIT + AREA + FRONTNUM + GOTO + STOPPONIT + AREA + LTBACKNUM;
    }
    else if(index_lt != -1 && index_xs_stop != -1)
    {
      TASKINFO = STARTPONIT + AREA + LTFRONTNUM + GOTO + STOPPONIT;
    }
    else if(index_lt != -1 && index_hc_stop != -1)
    {
      TASKINFO = STARTPONIT + AREA + LTFRONTNUM + GOTO + STOPPONIT + AREA + FRONTNUM;
    }
    else if(index_hc != -1 && index_hc_stop != -1)
    {
      TASKINFO = STARTPONIT + AREA + LTFRONTNUM + GOTO + STOPPONIT + AREA + BACKNUM;
    }
    else if((index_xs == -1 && index_hc == -1 && index_lt == -1) && \
            (index_xs_stop != -1 || index_hc_stop != -1 || index_lt_stop != -1))
    {
      TASKINFO = BCRW + STOPPONIT + AREA + BACKNUM;
    }
    else
    {
      TASKINFO = GOTOFREE;
    }

  //  qDebug() << "zuihou" << TASKINFO;

  ui.textBrowser->append(TASKINFO);

  std::string TASKINFOSEND = TASKINFO.toLocal8Bit().constData();     //文件中读取到的语句
  unsigned char* program_char;        // QByteArray转化为char*
  program_char = (unsigned char *)TASKINFOSEND.data();
  LedScreenShow(program_char);
}

void MainWindow::taskNameShow()
{
  //  QString word_s_start = "";
  //    QString word_s_start = QString::fromLocal8Bit("GWXS01M101");
  //    QString word_s_start = QString::fromLocal8Bit("GWHC21M103");
//        QString word_s_start = QString::fromLocal8Bit("GWHC30M103");
    //  QString word_s_start = QString::fromLocal8Bit("GWLT01M102");
    //  QString word_s_stop = QString::fromLocal8Bit("GWXS01M101");
//      QString word_s_stop = QString::fromLocal8Bit("GWHC07K103");
  //    QString word_s_stop = QString::fromLocal8Bit("GWLT01M102");
  //    QString word_s_stop = QString::fromLocal8Bit("GWHC35M103");

//        QString word_s_start = QString::fromLocal8Bit("GWHC19K201");
//        QString word_s_start = QString::fromLocal8Bit("GWHC46M112");
//        QString word_s_start = QString::fromLocal8Bit("GWYB11M104");
//        QString word_s_start = QString::fromLocal8Bit("GWSM01M100");
//        QString word_s_start = QString::fromLocal8Bit("GWSM01K100");
//          QString word_s_stop = QString::fromLocal8Bit("GWSM01K100");


//

//          QString word_s_start = QString::fromLocal8Bit("GWMB01M203");
//        QString word_s_stop = QString::fromLocal8Bit("GWPM02M101");

//        QString word_s_start = QString::fromLocal8Bit("GWPM02M101");
//      QString word_s_stop = QString::fromLocal8Bit("GWMB01M203");

//        QString word_s_stop = QString::fromLocal8Bit("GWYB18M101");

      QString word_s_start = QString::fromLocal8Bit(mission_info_.taskStartPoint.c_str());
      QString word_s_stop = QString::fromLocal8Bit(mission_info_.taskStopPoint.c_str());

      QString TASKINFO;
    //  QString FROM = QString::fromLocal8Bit("从");
      QString XSJT = QString::fromLocal8Bit("细纱");
      QString GT = QString::fromLocal8Bit("管桶");
      QString ST = QString::fromLocal8Bit("纱桶");
      QString SMLEFT = QString::fromLocal8Bit("左");
      QString SMRIGHT = QString::fromLocal8Bit("右");
      QString GOTO = QString::fromLocal8Bit("-");
      QString LTJT = QString::fromLocal8Bit("络筒");
      QString ZLGT = QString::fromLocal8Bit("自络管桶");
      QString ZLST = QString::fromLocal8Bit("自络纱筒");
      QString HCJT = QString::fromLocal8Bit("缓存");
      QString AREA = QString::fromLocal8Bit("区");
      QString GOTOFREE = QString::fromLocal8Bit("回空闲点");
      QString BCRW = QString::fromLocal8Bit("半程任务终点--");
      QString QSLMB = QString::fromLocal8Bit("棉包");
      QString QSLPM = QString::fromLocal8Bit("配棉");
      QString HGANG = QString::fromLocal8Bit("--");
      QString QSCX = QString::fromLocal8Bit("线");
      QString BT = QString::fromLocal8Bit("并条");
      QString SM = QString::fromLocal8Bit("梳棉");
      QString SMK = QString::fromLocal8Bit("空");
      QString SMM = QString::fromLocal8Bit("满");
      QString SMJTDW = QString::fromLocal8Bit("满");

      QString TKQ = QString::fromLocal8Bit("套空区");
      QString TMQ = QString::fromLocal8Bit("套满区");
      QString South = QString::fromLocal8Bit("南");
      QString North = QString::fromLocal8Bit("北");
      QString YBJT = QString::fromLocal8Bit("预并");

      QString STARTPONIT;
      QString STOPPONIT;

//      int len_start = strlen(word_s_start);
//      int len_stop = strlen(word_s_stop);

//      if(len_start != 0 )

      if(CarTypeStatus == 4)
      {
        int index_mb = word_s_start.indexOf("MB");
        int index_pm = word_s_start.indexOf("PM");

        if(index_mb != -1)
        {
          QString MBCX = word_s_start.mid(4,2);     //棉包产线
          QString MBQY = word_s_start.mid(5,1);     //区域
          QString MBDW = word_s_start.mid(8,2);     //点位

          STARTPONIT = QSLMB + MBCX + QSCX + MBQY + AREA + MBDW;
        }
        else if(index_pm != -1)
        {
          QString PMCX = word_s_start.mid(4,2);     //棉包产线
          QString PMQY = word_s_start.mid(5,1);     //区域
          QString PMDW = word_s_start.mid(8,2);     //点位

          STARTPONIT = QSLPM + PMCX + QSCX + PMQY + AREA + PMDW;
        }
//        else if(index_xs == -1 && index_hc == -1 && index_lt == -1 && index_yb == -1)
//        {
//          STARTPONIT == BCRW;
//        }
//        qDebug() << STARTPONIT;


        int index_mb_stop = word_s_stop.indexOf("MB");
        int index_pm_stop = word_s_stop.indexOf("PM");

        if(index_mb_stop != -1)
        {
          QString MBCX = word_s_stop.mid(4,2);     //棉包产线
          QString MBQY = word_s_stop.mid(5,1);     //区域
          QString MBDW = word_s_stop.mid(8,2);     //点位

          STOPPONIT = QSLMB + MBCX + QSCX + MBQY + AREA + MBDW;
        }
        else if(index_pm_stop != -1)
        {
          QString PMCX = word_s_stop.mid(4,2);     //棉包产线
          QString PMQY = word_s_stop.mid(5,1);     //区域
          QString PMDW = word_s_stop.mid(8,2);     //点位

          STOPPONIT = QSLPM + PMCX + QSCX + PMQY + AREA + PMDW;
        }
  //      qDebug() << "stop_point = " <<  STOPPONIT;

        //XS-hc  xs-lt  hc-lt hc-xs lt-hc lt-xs

        if(index_mb != -1 && index_pm_stop != -1)
        {
          TASKINFO = STARTPONIT + HGANG + STOPPONIT;
        }
        else if(index_pm != -1 && index_mb_stop != -1)
        {
          TASKINFO = STARTPONIT + HGANG + STOPPONIT;
        }
        else
        {
          TASKINFO = GOTOFREE;
        }
      }
      if(CarTypeStatus == 1)
      {
        int index_xs = word_s_start.indexOf("XS");
        int index_hc = word_s_start.indexOf("HC");
        int index_lt = word_s_start.indexOf("LT");
        int index_yb = word_s_start.indexOf("YB");
        int index_sm = word_s_start.indexOf("SM");

        if(index_sm != -1)
        {
          QString SMJT = word_s_start.mid(4,2);
          QString SMTW = word_s_start.mid(7,3);
          QString KM_SM = word_s_start.mid(6,1);

          //新疆显示
          if(KM_SM == "K" )
          {
            SMJTDW = SM + SMJT + SMK + SMTW;
          }
          else if(KM_SM == "M")
          {
            SMJTDW = SM + SMJT + SMM + SMTW;
          }
          STARTPONIT = SMJTDW;
        }
        else if(index_xs != -1)
        {
          for(int i=0; i<100; i++)
          {
            if(i<10)
            {
               QString sm = "XS0";
               QString num = QString::number(i, 10);
               QString sm_num = sm + num;
               int k = word_s_start.indexOf(sm_num);
               if(k != -1)
               {
                 XSJT = XSJT + num;
               }
            }
            else
            {
              QString sm = "XS";
              QString num = QString::number(i, 10);
              QString sm_num = sm + num;
              int k = word_s_start.indexOf(sm_num);
              if(k != -1)
              {
                XSJT = XSJT + num;
              }
            }
          }
          STARTPONIT = XSJT;
        }
        else if(index_hc != -1)
        {
          int NUM_HC = word_s_start.mid(4,1).toInt();
          int NUM_HC_2 = word_s_start.mid(4,2).toInt();
          QString KM_HC =  word_s_start.mid(6,1);
          int NB_HC = word_s_start.mid(7,1).toInt();
          QString KM_NUM =  word_s_start.mid(8,2);
          QString QY_NUM = QString::number(NUM_HC, 10);
          QString QY_NUM_2 = QString::number(NUM_HC_2, 10);
          QString QY_NUM_BACk = QString::number(NB_HC, 10);
          QString HC_DW_NUM = word_s_start.mid(7,3);

          //新疆显示
          if(KM_HC == "K" )
          {
            HCJT = SM + HCJT + QY_NUM_2 + AREA + HC_DW_NUM;
          }
          else if(KM_HC == "M")
          {
            HCJT = BT + HCJT + QY_NUM_2 + AREA + HC_DW_NUM;
          }
          //三阳显示
//          if(NUM_HC >= 1 && NUM_HC < 4)
//          {
//            //
//            if(NB_HC == 1)
//            {
//              if(KM_HC == "K" )
//              {
//                HCJT = QY_NUM + TKQ + North;
//              }
//              else if(KM_HC == "M")
//              {
//                HCJT = QY_NUM + TMQ + North;
//              }
//            }
//            else
//            {
//              if(KM_HC == "K" )
//              {
//                HCJT = QY_NUM + TKQ + South;
//              }
//              else if(KM_HC == "M")
//              {
//                HCJT = QY_NUM + TMQ + South;
//              }
//            }

//          }
//          else if(NUM_HC >= 4)
//          {
//            if(KM_HC == "K" )
//            {
//              HCJT = QY_NUM + TKQ + QY_NUM_BACk;
//            }
//            else if(KM_HC == "M")
//            {
//              HCJT = QY_NUM + TMQ + QY_NUM_BACk;
//            }
//          }

          STARTPONIT = HCJT;
        }
        else if(index_lt != -1)
        {
          for(int i=0; i<100; i++)
          {
            if(i<10)
            {
               QString sm = "LT0";
               QString num = QString::number(i, 10);
               QString sm_num = sm + num;
               int k = word_s_start.indexOf(sm_num);
               if(k != -1)
               {
                 LTJT = ZLST + num;
               }
            }
            else
            {
              QString sm = "LT";
              QString num = QString::number(i, 10);
              QString sm_num = sm + num;
              int k = word_s_start.indexOf(sm_num);
              if(k != -1)
              {
                LTJT = LTJT + num;
              }
            }
          }
          STARTPONIT = LTJT;
        }
        else if(index_yb != -1)
        {
          QString YBQY = word_s_start.mid(4,2);
          QString YBDW = word_s_start.mid(7,3);

          YBJT = YBJT + YBQY + AREA + YBDW;
          STARTPONIT = YBJT;
        }
        else if(index_xs == -1 && index_hc == -1 && index_lt == -1 && index_yb == -1)
        {
          STARTPONIT == BCRW;
        }
  //      qDebug() << STARTPONIT;


        int index_xs_stop = word_s_stop.indexOf("XS");
        int index_hc_stop = word_s_stop.indexOf("HC");
        int index_lt_stop = word_s_stop.indexOf("LT");
        int index_yb_stop = word_s_stop.indexOf("YB");
        int index_sm_stop = word_s_stop.indexOf("SM");

        if(index_sm_stop != -1)
        {
          QString SMJT = word_s_start.mid(4,2);
          QString SMTW = word_s_start.mid(7,3);
          QString KM_SM = word_s_start.mid(6,1);

          //新疆显示
          if(KM_SM == "K" )
          {
            SM = SM + SMJT + SMK + SMTW;
          }
          else if(KM_SM == "M")
          {
            SM = SM + SMJT + SMM + SMTW;
          }
          STOPPONIT = SM;
        }
        else if(index_xs_stop != -1)
        {
          for(int i=0; i<100; i++)
          {
            if(i<10)
            {
               QString sm = "XS0";
               QString num = QString::number(i, 10);
               QString sm_num = sm + num;
               int k = word_s_stop.indexOf(sm_num);
               if(k != -1)
               {
                 XSJT = XSJT + num;
               }
            }
            else
            {
              QString sm = "XS";
              QString num = QString::number(i, 10);
              QString sm_num = sm + num;
              int k = word_s_stop.indexOf(sm_num);
              if(k != -1)
              {
                XSJT = XSJT + num;
              }
            }
          }
          STOPPONIT = XSJT;
        }
        else if(index_hc_stop != -1)
        {
          int NUM_HC = word_s_stop.mid(4,1).toInt();
          int NUM_HC_2 = word_s_start.mid(4,2).toInt();
          QString KM_HC =  word_s_stop.mid(6,1);
          int NB_HC = word_s_stop.mid(7,1).toInt();
          QString KM_NUM =  word_s_stop.mid(8,2);
          QString QY_NUM = QString::number(NUM_HC, 10);
          QString QY_NUM_2 = QString::number(NUM_HC_2, 10);
          QString QY_NUM_BACk = QString::number(NB_HC, 10);
          QString HC_DW_NUM = word_s_start.mid(7,3);

          //新疆缓存
          //新疆显示
          if(KM_HC == "K" )
          {
            HCJT = SM + HCJT + QY_NUM_2 + AREA + HC_DW_NUM;
          }
          else if(KM_HC == "M")
          {
            HCJT = BT + HCJT + QY_NUM_2 + AREA + HC_DW_NUM;
          }
          //三阳缓存
//          if(NUM_HC >= 1 && NUM_HC < 4)
//          {

//            if(NB_HC == 1)
//            {
//              if(KM_HC == "K" )
//              {
//                HCJT = QY_NUM + TKQ + North + KM_NUM;
//              }
//              else if(KM_HC == "M")
//              {
//                HCJT = QY_NUM + TMQ + North + KM_NUM;
//              }
//            }
//            else
//            {
//              if(KM_HC == "K" )
//              {
//                HCJT = QY_NUM + TKQ + South + KM_NUM;
//              }
//              else if(KM_HC == "M")
//              {
//                HCJT = QY_NUM + TMQ + South + KM_NUM;
//              }
//            }

//          }
//          else if(NUM_HC >= 4)
//          {
//            if(KM_HC == "K" )
//            {
//              HCJT = QY_NUM + TKQ + QY_NUM_BACk + KM_NUM;
//            }
//            else if(KM_HC == "M")
//            {
//              HCJT = QY_NUM + TMQ + QY_NUM_BACk + KM_NUM;
//            }
//          }

          STOPPONIT = HCJT;
        }
        else if(index_lt_stop != -1)
        {
          for(int i=0; i<100; i++)
          {
            if(i<10)
            {
               QString sm = "LT0";
               QString num = QString::number(i, 10);
               QString sm_num = sm + num;
               int k = word_s_stop.indexOf(sm_num);
               if(k != -1)
               {
                 LTJT = ZLST + num;
               }
            }
            else
            {
              QString sm = "LT";
              QString num = QString::number(i, 10);
              QString sm_num = sm + num;
              int k = word_s_stop.indexOf(sm_num);
              if(k != -1)
              {
                LTJT = LTJT + num;
              }
            }
          }
          STOPPONIT = LTJT;
        }
        else if(index_yb_stop != -1)
        {
          QString YBQY = word_s_stop.mid(4,2);
          QString YBDW = word_s_stop.mid(7,3);

          YBJT = YBJT + YBQY + AREA + YBDW;
          STOPPONIT = YBJT;
        }
  //      qDebug() << "stop_point = " <<  STOPPONIT;


        QString FRONTNUM = word_s_start.mid(8, 2);
        QString BACKNUM = word_s_stop.mid(8, 2);
        QString LTFRONTNUM = word_s_start.mid(8, 2);
        QString LTBACKNUM = word_s_stop.mid(8, 2);

        //XS-hc  xs-lt  hc-lt hc-xs lt-hc lt-xs

        if(index_xs != -1 && index_hc_stop != -1)
        {
          TASKINFO = STARTPONIT + GOTO + STOPPONIT + AREA + BACKNUM;
        }
        else if(index_xs != -1 && index_lt_stop != -1)
        {
          TASKINFO = STARTPONIT + GOTO + STOPPONIT + AREA + LTBACKNUM;
        }
        else if(index_hc != -1 && index_xs_stop != -1)
        {
          TASKINFO = STARTPONIT + AREA + FRONTNUM + GOTO + STOPPONIT;
        }
        else if(index_hc != -1 && index_lt_stop != -1)
        {
          TASKINFO = STARTPONIT + AREA + FRONTNUM + GOTO + STOPPONIT + AREA + LTBACKNUM;
        }
        else if(index_lt != -1 && index_xs_stop != -1)
        {
          TASKINFO = STARTPONIT + AREA + LTFRONTNUM + GOTO + STOPPONIT;
        }
        else if(index_lt != -1 && index_hc_stop != -1)
        {
          TASKINFO = STARTPONIT + AREA + LTFRONTNUM + GOTO + STOPPONIT + AREA + FRONTNUM;
        }
        else if(index_hc != -1 && index_hc_stop != -1)
        {
          TASKINFO = STARTPONIT + AREA + LTFRONTNUM + GOTO + STOPPONIT + AREA + BACKNUM;
        }
        else if(index_hc != -1 && index_yb_stop != -1)
        {
          TASKINFO = STARTPONIT + GOTO + STOPPONIT;
        }
        else if(index_yb != -1 && index_hc_stop != -1)
        {
          TASKINFO = STARTPONIT + GOTO + STOPPONIT;
        }
        else if(index_sm != -1 && index_hc_stop != -1) //shumian-huancun
        {
          TASKINFO = STARTPONIT + GOTO + STOPPONIT;
        }
        else if(index_hc != -1 && index_sm_stop != -1) //huancun-shumian
        {
           TASKINFO = STARTPONIT + GOTO + STOPPONIT;
        }
        else if(index_sm != -1 && index_yb_stop != -1) //shumian-yubing
        {
           TASKINFO = STARTPONIT + GOTO + STOPPONIT;
        }
        else if(index_yb != -1 && index_sm_stop != -1) //yubing-shumian
        {
           TASKINFO = STARTPONIT + GOTO + STOPPONIT;
        }
        else if((index_xs == -1 && index_hc == -1 && index_lt == -1 && index_yb == -1 && index_sm == -1) && \
                (index_xs_stop != -1 || index_hc_stop != -1 || index_lt_stop != -1) || index_yb_stop != -1 || \
                index_sm_stop != -1)
        {
          TASKINFO = BCRW + STOPPONIT + AREA + BACKNUM;
        }
        else
        {
          TASKINFO = GOTOFREE;
        }
      }



    //  qDebug() << "zuihou" << TASKINFO;

    ui.textBrowser->append(TASKINFO);

    QPalette color;
    QString word_str;
    QFont font;

//    if(agv_loc_status == 0 || agv_loc_status == 2)
//    {
//      font.setPointSize(WORD_SIZE);
//      ui.TaskType->setFont(font);
//      word_str = QString::fromLocal8Bit("");
//      ui.TaskType->setText(word_str);
//      color.setColor(QPalette::WindowText,Qt::green);
//      ui.TaskType->setPalette(color);
//    }
//    else
    {
      font.setPointSize(WORD_SIZE);
      ui.TaskType->setFont(font);
      word_str = TASKINFO;
      ui.TaskType->setText(word_str);
      color.setColor(QPalette::WindowText,Qt::green);
      ui.TaskType->setPalette(color);
    }


//    std::string TASKINFOSEND = TASKINFO.toLocal8Bit().constData();     //文件中读取到的语句
//    unsigned char* program_char;        // QByteArray转化为char*
//    program_char = (unsigned char *)TASKINFOSEND.data();
//    LedScreenShow(program_char);
}

int MainWindow::SetLedStatus(uint8_t num, uint8_t cartype)
{
        QFile file("/home/lk/auto_start/para.json");
//          QFile file("/home/sjx/auto_start/para.json");


    if (!file.open(QIODevice::ReadWrite | QIODevice::Text))
    {
//      return 1;
      qDebug("setledstatus");
    }

    QByteArray bytes = file.readAll();// 把文件中所有数据读取出来
    QJsonDocument doc = QJsonDocument::fromJson(bytes);// 将读出的数据保存为Json文档

    // 解析JSON数据
    QJsonParseError error;
  //  QJsonDocument doc = QJsonDocument::fromJson(file.readAll(), &error);

    if (error.error != QJsonParseError::NoError) {
        qDebug() << "setledstatus-JSON解析错误:" << error.errorString();
//        return 1;
    }

    QJsonObject rootObj = doc.object();
    struct GetPara getpara;
    getpara.IPpb = rootObj.value("IPpb").toString();
    getpara.ServerIP = rootObj.value("ServerIP").toString();
    getpara.LedScreenIP = rootObj.value("LedScreenIP").toString();
    getpara.LedWord = rootObj.value("LedWord").toString();
    getpara.LedStatus = rootObj.value("LedStatus").toInt();
    getpara.LedOpenCloseMode = rootObj.value("LedOpenCloseMode").toInt();
    getpara.CarTypeMode = rootObj.value("CarTypeMode").toInt();
    getpara.PositionMode = rootObj.value("PositionMode").toInt();

    getIP = getpara.IPpb;
    getNetIP = getpara.ServerIP;
    ledScreenIP = getpara.LedScreenIP;
    ledWord = getpara.LedWord.toLocal8Bit().constData();     //文件中读取到的语句
    ledStatus = getpara.LedStatus;
    LedOpenCloseMode = getpara.LedOpenCloseMode;
    CarTypeMode = getpara.CarTypeMode;
    PositionMode = getpara.PositionMode;
//    sensorStatus = getpara.SensorStatus;

    // 修改配置项
    QJsonObject obj = doc.object();

    obj["IPpb"] = getIP;
    obj["ServerIP"] = getNetIP;
    obj["LedScreenIP"] = ledScreenIP;
    obj["LedWord"] = ledWord.data();
    if(cartype == 10)
    {
      obj["LedStatus"] = num;
      obj["CarTypeMode"] = CarTypeMode;
    }

    if(num == 10)
    {
       obj["LedStatus"] = ledStatus;
       obj["CarTypeMode"] = cartype;
    }
    obj["LedOpenCloseMode"] = LedOpenCloseMode;
    obj["PositionMode"] = PositionMode;

    doc.setObject(obj);

    if(cartype == 10)
    {
      ledStatus = num;
    }

    if(num == 10)
    {
      CarTypeMode = cartype;
    }

    file.seek(0);
    file.write(doc.toJson());
    file.resize(file.pos());
    file.close();
  //  qDebug() << "seeksucee";
}

int MainWindow::GetSensorPara()
{
//      QFile file("/home/sjx/auto_start/para1.json");
      QFile file("/home/lk/auto_start/para1.json");

      if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
      {
//         return 1;
      }

      QByteArray bytes = file.readAll();// 把文件中所有数据读取出来
      QJsonDocument doc = QJsonDocument::fromJson(bytes);// 将读出的数据保存为Json文档

      // 解析JSON数据
      QJsonParseError error;
    //  QJsonDocument doc = QJsonDocument::fromJson(file.readAll(), &error);

      if (error.error != QJsonParseError::NoError) {
//          qDebug() << "JSON解析错误:" << error.errorString();
//          return 1;
      }

      QJsonObject rootObj = doc.object();

      sensorStatus = rootObj.value("SensorStatus").toInt();

      qnode.sys_config_send_.head = 1;
      qnode.sys_config_send_.test = rootObj.value("test").toInt();
      qnode.sys_config_send_.actuator = rootObj.value("actuator").toInt();
      qnode.sys_config_send_.wheel = rootObj.value("wheel").toInt();
      qnode.sys_config_send_.carTray = rootObj.value("carTray").toInt();
      qnode.sys_config_send_.motor = rootObj.value("motor").toInt();
      qnode.sys_config_send_.leadScrew = rootObj.value("leadScrew").toInt();
      qnode.sys_config_send_.sensorMode = rootObj.value("sensorMode").toInt();
      qnode.sys_config_send_.ergImu = rootObj.value("ergImu").toInt();
      qnode.sys_config_send_.swhorn = rootObj.value("swhorn").toInt();
      qnode.sys_config_send_.swimpact = rootObj.value("swimpact").toInt();
      qnode.sys_config_send_.cfig2 = rootObj.value("cfig2").toInt();
      qnode.sys_config_send_.cfig3 = rootObj.value("cfig3").toInt();

      uint16_t tread_t = (rootObj.value("tread").toDouble()) * 1000;
      uint16_t tread_t_temp = (rootObj.value("tread").toDouble()) * 1000;

      qnode.sys_config_send_.cfig4 = tread_t >> 8;
      qnode.sys_config_send_.cfig5 = tread_t_temp;

      uint16_t axle_t = (rootObj.value("axle").toDouble()) * 1000;
      uint16_t axle_t_temp = (rootObj.value("axle").toDouble()) * 1000;

      qnode.sys_config_send_.cfig6 = axle_t >> 8;
      qnode.sys_config_send_.cfig7 = axle_t_temp;

//      qDebug("sensorStatus = %d", sensorStatus);

      qnode.sysConfigSendPublish(qnode.sys_config_send_);

      file.close();

      if(sensorStatus == 1)
      {
        ui.ChangeType1->setIcon(QIcon(":/image/chache/para1-2.png"));
        ui.ChangeType1->setIconSize(QSize(217,67));

        ui.ChangeType2->setIcon(QIcon(":/image/chache/para3-1.png"));
        ui.ChangeType2->setIconSize(QSize(217,67));

        ui.ChangeType3->setIcon(QIcon(":/image/chache/para2-1.png"));
        ui.ChangeType3->setIconSize(QSize(217,67));

        ui.ChangeType4->setIcon(QIcon(":/image/chache/para4-1.png"));
        ui.ChangeType4->setIconSize(QSize(217,67));
      }
      else if(sensorStatus == 2)
      {
        ui.ChangeType1->setIcon(QIcon(":/image/chache/para1-1.png"));
        ui.ChangeType1->setIconSize(QSize(217,67));

        ui.ChangeType2->setIcon(QIcon(":/image/chache/para3-2.png"));
        ui.ChangeType2->setIconSize(QSize(217,67));

        ui.ChangeType3->setIcon(QIcon(":/image/chache/para2-1.png"));
        ui.ChangeType3->setIconSize(QSize(217,67));

        ui.ChangeType4->setIcon(QIcon(":/image/chache/para4-1.png"));
        ui.ChangeType4->setIconSize(QSize(217,67));
      }
      else if(sensorStatus == 3)
      {
        ui.ChangeType1->setIcon(QIcon(":/image/chache/para1-1.png"));
        ui.ChangeType1->setIconSize(QSize(217,67));

        ui.ChangeType2->setIcon(QIcon(":/image/chache/para3-1.png"));
        ui.ChangeType2->setIconSize(QSize(217,67));

        ui.ChangeType3->setIcon(QIcon(":/image/chache/para2-2.png"));
        ui.ChangeType3->setIconSize(QSize(217,67));

        ui.ChangeType4->setIcon(QIcon(":/image/chache/para4-1.png"));
        ui.ChangeType4->setIconSize(QSize(217,67));
      }
      else if(sensorStatus == 4)
      {
        ui.ChangeType1->setIcon(QIcon(":/image/chache/para1-1.png"));
        ui.ChangeType1->setIconSize(QSize(217,67));

        ui.ChangeType2->setIcon(QIcon(":/image/chache/para3-1.png"));
        ui.ChangeType2->setIconSize(QSize(217,67));

        ui.ChangeType3->setIcon(QIcon(":/image/chache/para2-1.png"));
        ui.ChangeType3->setIconSize(QSize(217,67));

        ui.ChangeType4->setIcon(QIcon(":/image/chache/para4-2.png"));
        ui.ChangeType4->setIconSize(QSize(217,67));
      }

      return 1;
}

void MainWindow::ReceivePara()
{
  sys_config_receive_.head.info = qnode.sys_config_re_.head;
  sys_config_receive_.test = qnode.sys_config_re_.test;
  sys_config_receive_.actuator = qnode.sys_config_re_.actuator;
  sys_config_receive_.wheel = qnode.sys_config_re_.wheel;
  sys_config_receive_.carTray = qnode.sys_config_re_.carTray;
  sys_config_receive_.motor = qnode.sys_config_re_.motor;
  sys_config_receive_.leadScrew = qnode.sys_config_re_.leadScrew;
  sys_config_receive_.sensorMode = qnode.sys_config_re_.sensorMode;
  sys_config_receive_.ergImu = qnode.sys_config_re_.ergImu;
  sys_config_receive_.swhorn = qnode.sys_config_re_.swhorn;
  sys_config_receive_.swimpact = qnode.sys_config_re_.swimpact;
  sys_config_receive_.cfig2 = qnode.sys_config_re_.cfig2;
  sys_config_receive_.cfig3 = qnode.sys_config_re_.cfig3;
  sys_config_receive_.cfig4 = qnode.sys_config_re_.cfig4;
  sys_config_receive_.cfig5 = qnode.sys_config_re_.cfig5;
  sys_config_receive_.cfig6 = qnode.sys_config_re_.cfig6;
  sys_config_receive_.cfig7 = qnode.sys_config_re_.cfig7;

  treadAll = sys_config_receive_.cfig4 << 8 | sys_config_receive_.cfig5;
  axleAll = sys_config_receive_.cfig6 << 8 | sys_config_receive_.cfig7;

//  sys_config_receive_.head.info = qnode.sys_config_send_.head;
//  sys_config_receive_.test = qnode.sys_config_send_.test;
//  sys_config_receive_.actuator = qnode.sys_config_send_.actuator;
//  sys_config_receive_.wheel = qnode.sys_config_send_.wheel;
//  sys_config_receive_.carTray = qnode.sys_config_send_.carTray;
//  sys_config_receive_.motor = qnode.sys_config_send_.motor;
//  sys_config_receive_.leadScrew = qnode.sys_config_send_.leadScrew;
//  sys_config_receive_.sensorMode = qnode.sys_config_send_.sensorMode;
//  sys_config_receive_.ergImu = qnode.sys_config_send_.ergImu;
//  sys_config_receive_.swhorn = qnode.sys_config_send_.swhorn;
//  sys_config_receive_.swimpact = qnode.sys_config_send_.swimpact;
//  sys_config_receive_.cfig2 = qnode.sys_config_send_.cfig2;
//  sys_config_receive_.cfig3 = qnode.sys_config_send_.cfig3;
//  sys_config_receive_.cfig4 = qnode.sys_config_send_.cfig4;
//  sys_config_receive_.cfig5 = qnode.sys_config_send_.cfg5;
//  sys_config_receive_.cfig6 = qnode.sys_config_send_.cfg6;
}

void MainWindow::RobotParaShow()
{
  QString word_str;
  QPalette color;
  QFont font;

  if(sys_config_receive_.head.bit.cfg == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("默认状态");
    ui.ConfigStatusLa->setFont(font);
    ui.ConfigStatusLa->setText(QString(word_str));                //显示页数
    ui.ConfigStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.ConfigStatusLa->setPalette(color);
  }
  else  if(sys_config_receive_.head.bit.cfg == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("agv配置");
    ui.ConfigStatusLa->setFont(font);
    ui.ConfigStatusLa->setText(QString(word_str));                //显示页数
    ui.ConfigStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ConfigStatusLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.ConfigStatusLa->setFont(font);
    ui.ConfigStatusLa->setText(QString(word_str));                //显示页数
    ui.ConfigStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.ConfigStatusLa->setPalette(color);
  }

  if(sys_config_receive_.test == 0)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("默认状态");
    ui.TestStatusLa->setFont(font);
    ui.TestStatusLa->setText(QString(word_str));                //显示页数
    ui.TestStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.TestStatusLa->setPalette(color);
  }
  else  if(sys_config_receive_.test == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("正式版");
    ui.TestStatusLa->setFont(font);
    ui.TestStatusLa->setText(QString(word_str));                //显示页数
    ui.TestStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.TestStatusLa->setPalette(color);
  }
  else  if(sys_config_receive_.test == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("测试版");
    ui.TestStatusLa->setFont(font);
    ui.TestStatusLa->setText(QString(word_str));                //显示页数
    ui.TestStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.TestStatusLa->setPalette(color);
  }
  else  if(sys_config_receive_.test == 3)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("裸车版");
    ui.TestStatusLa->setFont(font);
    ui.TestStatusLa->setText(QString(word_str));                //显示页数
    ui.TestStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.TestStatusLa->setPalette(color);
  }
  else  if(sys_config_receive_.test == 9)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("正式+延时");
    ui.TestStatusLa->setFont(font);
    ui.TestStatusLa->setText(QString(word_str));                //显示页数
    ui.TestStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.TestStatusLa->setPalette(color);
  }
  else  if(sys_config_receive_.test == 10)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("测试+延时");
    ui.TestStatusLa->setFont(font);
    ui.TestStatusLa->setText(QString(word_str));                //显示页数
    ui.TestStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.TestStatusLa->setPalette(color);
  }
  else  if(sys_config_receive_.test == 11)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("裸车+延时");
    ui.TestStatusLa->setFont(font);
    ui.TestStatusLa->setText(QString(word_str));                //显示页数
    ui.TestStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.TestStatusLa->setPalette(color);
  }
//  else
//  {
//    font.setPointSize(WORD_SIZE);
//    word_str = QString::fromLocal8Bit("参数错误");
//    ui.TestStatusLa->setFont(font);
//    ui.TestStatusLa->setText(QString(word_str));                //显示页数
//    ui.TestStatusLa->setAlignment(Qt::AlignLeft);
//    color.setColor(QPalette::WindowText,Qt::red);
//    ui.TestStatusLa->setPalette(color);
//  }

  if(sys_config_receive_.actuator == 0)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("默认状态");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.ActuatorLa->setPalette(color);
  }
  else  if(sys_config_receive_.actuator == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("1000抱手");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ActuatorLa->setPalette(color);
  }
  else  if(sys_config_receive_.actuator == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("600抱手");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ActuatorLa->setPalette(color);
  }
  else  if(sys_config_receive_.actuator == 3)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("1200抱手");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ActuatorLa->setPalette(color);
  }
  else  if(sys_config_receive_.actuator == 4)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("光电+磁吸");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ActuatorLa->setPalette(color);
  }
  else  if(sys_config_receive_.actuator == 5)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("超声波+磁吸");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ActuatorLa->setPalette(color);
  }
  else  if(sys_config_receive_.actuator == 6)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("450抱手");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ActuatorLa->setPalette(color);
  }
  else  if(sys_config_receive_.actuator == 11)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("1米加推杆");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ActuatorLa->setPalette(color);
  }
  else  if(sys_config_receive_.actuator == 12)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("600加推杆");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ActuatorLa->setPalette(color);
  }
  else  if(sys_config_receive_.actuator == 13)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("1.2米加推杆");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ActuatorLa->setPalette(color);
  }
  else  if(sys_config_receive_.actuator == 16)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("450抱手推杆");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ActuatorLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.ActuatorLa->setFont(font);
    ui.ActuatorLa->setText(QString(word_str));                //显示页数
    ui.ActuatorLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.ActuatorLa->setPalette(color);
  }


  if(sys_config_receive_.wheel == 0)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("默认状态");
    ui.WheelLa->setFont(font);
    ui.WheelLa->setText(QString(word_str));                //显示页数
    ui.WheelLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.WheelLa->setPalette(color);
  }
  else  if(sys_config_receive_.wheel == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("直径180");
    ui.WheelLa->setFont(font);
    ui.WheelLa->setText(QString(word_str));                //显示页数
    ui.WheelLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelLa->setPalette(color);
  }
  else  if(sys_config_receive_.wheel == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("直径150");
    ui.WheelLa->setFont(font);
    ui.WheelLa->setText(QString(word_str));                //显示页数
    ui.WheelLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelLa->setPalette(color);
  }
  else  if(sys_config_receive_.wheel == 3)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("直径200");
    ui.WheelLa->setFont(font);
    ui.WheelLa->setText(QString(word_str));                //显示页数
    ui.WheelLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelLa->setPalette(color);
  }
  else  if(sys_config_receive_.wheel == 4)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("直径250");
    ui.WheelLa->setFont(font);
    ui.WheelLa->setText(QString(word_str));                //显示页数
    ui.WheelLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.WheelLa->setFont(font);
    ui.WheelLa->setText(QString(word_str));                //显示页数
    ui.WheelLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.WheelLa->setPalette(color);
  }

  if(sys_config_receive_.carTray == 0)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("默认状态");
    ui.CarTrayLa->setFont(font);
    ui.CarTrayLa->setText(QString(word_str));                //显示页数
    ui.CarTrayLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.CarTrayLa->setPalette(color);
  }
//  else  if(sys_config_receive_.carTray == 1)
//  {
//    font.setPointSize(WORD_SIZE);
//    word_str = QString::fromLocal8Bit("1代底盘");
//    ui.CarTrayLa->setFont(font);
//    ui.CarTrayLa->setText(QString(word_str));                //显示页数
//    ui.CarTrayLa->setAlignment(Qt::AlignLeft);
//    color.setColor(QPalette::WindowText,Qt::green);
//    ui.CarTrayLa->setPalette(color);
//  }
//  else  if(sys_config_receive_.carTray == 2)
//  {
//    font.setPointSize(WORD_SIZE);
//    word_str = QString::fromLocal8Bit("三代底盘");
//    ui.CarTrayLa->setFont(font);
//    ui.CarTrayLa->setText(QString(word_str));                //显示页数
//    ui.CarTrayLa->setAlignment(Qt::AlignLeft);
//    color.setColor(QPalette::WindowText,Qt::green);
//    ui.CarTrayLa->setPalette(color);
//  }
  else  if(sys_config_receive_.carTray == 3)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("四代底盘");
    ui.CarTrayLa->setFont(font);
    ui.CarTrayLa->setText(QString(word_str));                //显示页数
    ui.CarTrayLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.CarTrayLa->setPalette(color);
  }
  else  if(sys_config_receive_.carTray == 5)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("自定义底盘");
    ui.CarTrayLa->setFont(font);
    ui.CarTrayLa->setText(QString(word_str));                //显示页数
    ui.CarTrayLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.CarTrayLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.CarTrayLa->setFont(font);
    ui.CarTrayLa->setText(QString(word_str));                //显示页数
    ui.CarTrayLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.CarTrayLa->setPalette(color);
  }

  if(sys_config_receive_.motor == 0)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("默认状态");
    ui.MotorTypeLa->setFont(font);
    ui.MotorTypeLa->setText(QString(word_str));                //显示页数
    ui.MotorTypeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.MotorTypeLa->setPalette(color);
  }
  else  if(sys_config_receive_.motor == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("HLS");
    ui.MotorTypeLa->setFont(font);
    ui.MotorTypeLa->setText(QString(word_str));                //显示页数
    ui.MotorTypeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.MotorTypeLa->setPalette(color);
  }
  else  if(sys_config_receive_.motor == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("LS");
    ui.MotorTypeLa->setFont(font);
    ui.MotorTypeLa->setText(QString(word_str));                //显示页数
    ui.MotorTypeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.MotorTypeLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.MotorTypeLa->setFont(font);
    ui.MotorTypeLa->setText(QString(word_str));                //显示页数
    ui.MotorTypeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.MotorTypeLa->setPalette(color);
  }

  if(sys_config_receive_.leadScrew == 0)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("默认状态");
    ui.LeadScrewLa->setFont(font);
    ui.LeadScrewLa->setText(QString(word_str));                //显示页数
    ui.LeadScrewLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.LeadScrewLa->setPalette(color);
  }
  else  if(sys_config_receive_.leadScrew == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("4mm");
    ui.LeadScrewLa->setFont(font);
    ui.LeadScrewLa->setText(QString(word_str));                //显示页数
    ui.LeadScrewLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.LeadScrewLa->setPalette(color);
  }
  else  if(sys_config_receive_.leadScrew == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("5mm");
    ui.LeadScrewLa->setFont(font);
    ui.LeadScrewLa->setText(QString(word_str));                //显示页数
    ui.LeadScrewLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.LeadScrewLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.LeadScrewLa->setFont(font);
    ui.LeadScrewLa->setText(QString(word_str));                //显示页数
    ui.LeadScrewLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.LeadScrewLa->setPalette(color);
  }

  if(sys_config_receive_.sensorMode == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("同时启用");
    ui.SensorModeLa->setFont(font);
    ui.SensorModeLa->setText(QString(word_str));                //显示页数
    ui.SensorModeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.SensorModeLa->setPalette(color);
  }
  else  if(sys_config_receive_.sensorMode == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("掉筒检测");
    ui.SensorModeLa->setFont(font);
    ui.SensorModeLa->setText(QString(word_str));                //显示页数
    ui.SensorModeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.SensorModeLa->setPalette(color);
  }
  else  if(sys_config_receive_.sensorMode == 3)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("同时禁用");
    ui.SensorModeLa->setFont(font);
    ui.SensorModeLa->setText(QString(word_str));                //显示页数
    ui.SensorModeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.SensorModeLa->setPalette(color);
  }
  else  if(sys_config_receive_.sensorMode == 4)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("到位检测");
    ui.SensorModeLa->setFont(font);
    ui.SensorModeLa->setText(QString(word_str));                //显示页数
    ui.SensorModeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.SensorModeLa->setPalette(color);
  }
  else  if(sys_config_receive_.sensorMode > 4)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("到位检测");
    ui.SensorModeLa->setFont(font);
    ui.SensorModeLa->setText(QString(word_str));                //显示页数
    ui.SensorModeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.SensorModeLa->setPalette(color);
  }

  if(sys_config_receive_.ergImu == 0)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("默认状态");
    ui.IMUDataLa->setFont(font);
    ui.IMUDataLa->setText(QString(word_str));                //显示页数
    ui.IMUDataLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.IMUDataLa->setPalette(color);
  }
  else  if(sys_config_receive_.ergImu == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("禁止上传");
    ui.IMUDataLa->setFont(font);
    ui.IMUDataLa->setText(QString(word_str));                //显示页数
    ui.IMUDataLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.IMUDataLa->setPalette(color);
  }
  else  if(sys_config_receive_.ergImu == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("上传IMU");
    ui.IMUDataLa->setFont(font);
    ui.IMUDataLa->setText(QString(word_str));                //显示页数
    ui.IMUDataLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.IMUDataLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.IMUDataLa->setFont(font);
    ui.IMUDataLa->setText(QString(word_str));                //显示页数
    ui.IMUDataLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.IMUDataLa->setPalette(color);
  }

  if(sys_config_receive_.swhorn == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("禁止语音");
    ui.SwHornLa->setFont(font);
    ui.SwHornLa->setText(QString(word_str));                //显示页数
    ui.SwHornLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.SwHornLa->setPalette(color);
  }
  else  if(sys_config_receive_.swhorn == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("IO模式");
    ui.SwHornLa->setFont(font);
    ui.SwHornLa->setText(QString(word_str));                //显示页数
    ui.SwHornLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.SwHornLa->setPalette(color);
  }
  else  if(sys_config_receive_.swhorn == 3)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("CAN模式");
    ui.SwHornLa->setFont(font);
    ui.SwHornLa->setText(QString(word_str));                //显示页数
    ui.SwHornLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.SwHornLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.SwHornLa->setFont(font);
    ui.SwHornLa->setText(QString(word_str));                //显示页数
    ui.SwHornLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.SwHornLa->setPalette(color);
  }

  if(sys_config_receive_.swimpact == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("只开防撞条");
    ui.ImpactStatusLa->setFont(font);
    ui.ImpactStatusLa->setText(QString(word_str));                //显示页数
    ui.ImpactStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ImpactStatusLa->setPalette(color);
  }
  else  if(sys_config_receive_.swimpact == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("关闭防撞条/UWB");
    ui.ImpactStatusLa->setFont(font);
    ui.ImpactStatusLa->setText(QString(word_str));                //显示页数
    ui.ImpactStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ImpactStatusLa->setPalette(color);
  }
  else  if(sys_config_receive_.swimpact == 16)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("开启防撞条/UWB");
    ui.ImpactStatusLa->setFont(font);
    ui.ImpactStatusLa->setText(QString(word_str));                //显示页数
    ui.ImpactStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ImpactStatusLa->setPalette(color);
  }
  else  if(sys_config_receive_.swimpact == 17)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("开UWB关防撞条");
    ui.ImpactStatusLa->setFont(font);
    ui.ImpactStatusLa->setText(QString(word_str));                //显示页数
    ui.ImpactStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ImpactStatusLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.ImpactStatusLa->setFont(font);
    ui.ImpactStatusLa->setText(QString(word_str));                //显示页数
    ui.ImpactStatusLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.ImpactStatusLa->setPalette(color);
  }

  if(sys_config_receive_.cfig2 == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("麦轮");
    ui.WheelTypeLa->setFont(font);
    ui.WheelTypeLa->setText(QString(word_str));                //显示页数
    ui.WheelTypeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelTypeLa->setPalette(color);
  }
  else  if(sys_config_receive_.cfig2 == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("差速轮");
    ui.WheelTypeLa->setFont(font);
    ui.WheelTypeLa->setText(QString(word_str));                //显示页数
    ui.WheelTypeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelTypeLa->setPalette(color);
  }
  else  if(sys_config_receive_.cfig2 == 3)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("舵轮");
    ui.WheelTypeLa->setFont(font);
    ui.WheelTypeLa->setText(QString(word_str));                //显示页数
    ui.WheelTypeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelTypeLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.WheelTypeLa->setFont(font);
    ui.WheelTypeLa->setText(QString(word_str));                //显示页数
    ui.WheelTypeLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.WheelTypeLa->setPalette(color);
  }

  if(sys_config_receive_.carTray == 0)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("默认轮距");
    ui.WheelTreadLa->setFont(font);
    ui.WheelTreadLa->setText(QString(word_str));                //显示页数
    ui.WheelTreadLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::white);
    ui.WheelTreadLa->setPalette(color);
  }
  else  if(sys_config_receive_.carTray == 1)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("1代轮距");
    ui.WheelTreadLa->setFont(font);
    ui.WheelTreadLa->setText(QString(word_str));                //显示页数
    ui.WheelTreadLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelTreadLa->setPalette(color);

    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("1代轴距");
    ui.WheelAxleBtnLa->setFont(font);
    ui.WheelAxleBtnLa->setText(QString(word_str));                //显示页数
    ui.WheelAxleBtnLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelAxleBtnLa->setPalette(color);

  }
  else  if(sys_config_receive_.carTray == 2)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("三代轮距");
    ui.WheelTreadLa->setFont(font);
    ui.WheelTreadLa->setText(QString(word_str));                //显示页数
    ui.WheelTreadLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelTreadLa->setPalette(color);

    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("三代轴距");
    ui.WheelAxleBtnLa->setFont(font);
    ui.WheelAxleBtnLa->setText(QString(word_str));                //显示页数
    ui.WheelAxleBtnLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelAxleBtnLa->setPalette(color);
  }
  else  if(sys_config_receive_.carTray == 3)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("四代轮距");
    ui.WheelTreadLa->setFont(font);
    ui.WheelTreadLa->setText(QString(word_str));                //显示页数
    ui.WheelTreadLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelTreadLa->setPalette(color);

    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("四代轴距");
    ui.WheelAxleBtnLa->setFont(font);
    ui.WheelAxleBtnLa->setText(QString(word_str));                //显示页数
    ui.WheelAxleBtnLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelAxleBtnLa->setPalette(color);
  }
  else  if(sys_config_receive_.carTray == 4)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("四代1.2轮距");
    ui.WheelTreadLa->setFont(font);
    ui.WheelTreadLa->setText(QString(word_str));                //显示页数
    ui.WheelTreadLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelTreadLa->setPalette(color);

    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("四代1.2轴距");
    ui.WheelAxleBtnLa->setFont(font);
    ui.WheelAxleBtnLa->setText(QString(word_str));                //显示页数
    ui.WheelAxleBtnLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelAxleBtnLa->setPalette(color);
  }
  else  if(sys_config_receive_.carTray == 5)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("自定义");
    ui.WheelTreadLa->setFont(font);
    ui.WheelTreadLa->setText(QString(word_str));                //显示页数
    ui.WheelTreadLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelTreadLa->setPalette(color);

    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("自定义");
    ui.WheelAxleBtnLa->setFont(font);
    ui.WheelAxleBtnLa->setText(QString(word_str));                //显示页数
    ui.WheelAxleBtnLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.WheelAxleBtnLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.WheelTreadLa->setFont(font);
    ui.WheelTreadLa->setText(QString(word_str));                //显示页数
    ui.WheelTreadLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.WheelTreadLa->setPalette(color);

    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.WheelAxleBtnLa->setFont(font);
    ui.WheelAxleBtnLa->setText(QString(word_str));                //显示页数
    ui.WheelAxleBtnLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.WheelAxleBtnLa->setPalette(color);
  }

  if(sys_config_receive_.cfig3 != 0)
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("减速比");
    ui.ReductionLa->setFont(font);
    ui.ReductionLa->setText(QString(word_str));                //显示页数
    ui.ReductionLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::green);
    ui.ReductionLa->setPalette(color);
  }
  else
  {
    font.setPointSize(WORD_SIZE);
    word_str = QString::fromLocal8Bit("参数错误");
    ui.ReductionLa->setFont(font);
    ui.ReductionLa->setText(QString(word_str));                //显示页数
    ui.ReductionLa->setAlignment(Qt::AlignLeft);
    color.setColor(QPalette::WindowText,Qt::red);
    ui.ReductionLa->setPalette(color);
  }

//  if(sys_config_receive_.carTray == 0)
//  {
//    font.setPointSize(WORD_SIZE);
//    word_str = QString::fromLocal8Bit("默认轴距");
//    ui.WheelAxleBtnLa->setFont(font);
//    ui.WheelAxleBtnLa->setText(QString(word_str));                //显示页数
//    ui.WheelAxleBtnLa->setAlignment(Qt::AlignLeft);
//    color.setColor(QPalette::WindowText,Qt::white);
//    ui.WheelAxleBtnLa->setPalette(color);
//  }
//  else  if(sys_config_receive_.carTray == 1)
//  {
//    font.setPointSize(WORD_SIZE);
//    word_str = QString::fromLocal8Bit("1代轴距");
//    ui.WheelAxleBtnLa->setFont(font);
//    ui.WheelAxleBtnLa->setText(QString(word_str));                //显示页数
//    ui.WheelAxleBtnLa->setAlignment(Qt::AlignLeft);
//    color.setColor(QPalette::WindowText,Qt::green);
//    ui.WheelAxleBtnLa->setPalette(color);
//  }
//  else  if(sys_config_receive_.carTray == 2)
//  {
//    font.setPointSize(WORD_SIZE);
//    word_str = QString::fromLocal8Bit("三代轴距");
//    ui.WheelAxleBtnLa->setFont(font);
//    ui.WheelAxleBtnLa->setText(QString(word_str));                //显示页数
//    ui.WheelAxleBtnLa->setAlignment(Qt::AlignLeft);
//    color.setColor(QPalette::WindowText,Qt::green);
//    ui.WheelAxleBtnLa->setPalette(color);
//  }
//  else  if(sys_config_receive_.carTray == 3)
//  {
//    font.setPointSize(WORD_SIZE);
//    word_str = QString::fromLocal8Bit("四代轴距");
//    ui.WheelAxleBtnLa->setFont(font);
//    ui.WheelAxleBtnLa->setText(QString(word_str));                //显示页数
//    ui.WheelAxleBtnLa->setAlignment(Qt::AlignLeft);
//    color.setColor(QPalette::WindowText,Qt::green);
//    ui.WheelAxleBtnLa->setPalette(color);
//  }
//  else  if(sys_config_receive_.carTray == 4)
//  {
//    font.setPointSize(WORD_SIZE);
//    word_str = QString::fromLocal8Bit("四代1.2轴距");
//    ui.WheelAxleBtnLa->setFont(font);
//    ui.WheelAxleBtnLa->setText(QString(word_str));                //显示页数
//    ui.WheelAxleBtnLa->setAlignment(Qt::AlignLeft);
//    color.setColor(QPalette::WindowText,Qt::green);
//    ui.WheelAxleBtnLa->setPalette(color);
//  }
}

int MainWindow::setSensorStatus(uint8_t num)
{
//  QFile file("/home/sjx/magnet_new/src/gui/para/para1.json");
  QFile file("/home/lk/auto_start/para1.json");
//  QFile file("/home/sjx/auto_start/para1.json");

  if (!file.open(QIODevice::ReadWrite | QIODevice::Text))
  {
    return 1;
  }

  QByteArray bytes = file.readAll();// 把文件中所有数据读取出来
  QJsonDocument doc = QJsonDocument::fromJson(bytes);// 将读出的数据保存为Json文档

  // 解析JSON数据
  QJsonParseError error;
//  QJsonDocument doc = QJsonDocument::fromJson(file.readAll(), &error);

  if (error.error != QJsonParseError::NoError)
  {
      qDebug() << "setSensorStatus-JSON解析错误:" << error.errorString();
      return 1;
  }

  QJsonObject rootObj = doc.object();

  sensorStatus = rootObj.value("SensorStatus").toInt();

  qnode.sys_config_send_.head = 1;
  qnode.sys_config_send_.test = rootObj.value("test").toInt();
  qnode.sys_config_send_.actuator = rootObj.value("actuator").toInt();
  qnode.sys_config_send_.wheel = rootObj.value("wheel").toInt();
  qnode.sys_config_send_.carTray = rootObj.value("carTray").toInt();
  qnode.sys_config_send_.motor = rootObj.value("motor").toInt();
  qnode.sys_config_send_.leadScrew = rootObj.value("leadScrew").toInt();
  qnode.sys_config_send_.sensorMode = rootObj.value("sensorMode").toInt();
  qnode.sys_config_send_.ergImu = rootObj.value("ergImu").toInt();
  qnode.sys_config_send_.swhorn = rootObj.value("swhorn").toInt();
  qnode.sys_config_send_.swimpact = rootObj.value("swimpact").toInt();
  qnode.sys_config_send_.cfig2 = rootObj.value("cfig2").toInt();
  qnode.sys_config_send_.cfig3 = rootObj.value("cfig3").toInt();

//  qnode.sysConfigSendPublish(qnode.sys_config_send_);

  double_t tread_t = rootObj.value("tread").toDouble();
  double_t axle_t = rootObj.value("axle").toDouble();

//  qnode.sys_config_send_.cfig4 = tread_t >> 8;
//  qnode.sys_config_send_.cfig5 = tread_t_temp;
//  qnode.sys_config_send_.cfig6 = axle_t >> 8;
//  qnode.sys_config_send_.cfig7 = axle_t_temp;

    // 修改配置项
  QJsonObject obj = doc.object();

  obj["SensorStatus"] = num;
  obj["head"] = 1;
  obj["test"] = qnode.sys_config_send_.test;
  obj["actuator"] = qnode.sys_config_send_.actuator;
  obj["wheel"] = qnode.sys_config_send_.wheel;
  obj["carTray"] = qnode.sys_config_send_.carTray;
  obj["motor"] = qnode.sys_config_send_.motor;
  obj["leadScrew"] = qnode.sys_config_send_.leadScrew;
  if(num == 1)
  {
    obj["sensorMode"] = 1;
    obj["swimpact"] = 1;
  }
  else if(num == 2)
  {
    obj["sensorMode"] = 1;
    obj["swimpact"] = 2;
  }
  else if(num == 3)
  {
    obj["sensorMode"] = 3;
    obj["swimpact"] = 1;
  }
  else if(num == 4)
  {
    obj["sensorMode"] = 3;
    obj["swimpact"] = 2;
  }

//  obj["sensorMode"] = qnode.sys_config_send_.sensorMode;
  obj["ergImu"] = qnode.sys_config_send_.ergImu;
  obj["swhorn"] = qnode.sys_config_send_.swhorn;
//  obj["swimpact"] = qnode.sys_config_send_.swimpact;
  obj["cfig2"] = qnode.sys_config_send_.cfig2;
  obj["cfig3"] = qnode.sys_config_send_.cfig3;
  obj["tread"] = tread_t;
  obj["axle"] = axle_t;

  doc.setObject(obj);
  file.seek(0);
  file.write(doc.toJson());
  file.resize(file.pos());
  file.close();

  sensorStatus = num;
//  qDebug() << "seeksucee";
}

//车型屏幕选择显示
void MainWindow::showCarTypeBtn()
{
  if(CarTypeMode == 1)
  {
    ui.CarTypeBSMotor5->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor5:focus{outline: none;}"
          "#CarTypeBSMotor5{"
          "background-image:url(:/image/chache/bulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );

    ui.CarTypeBSMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor6:focus{outline: none;}"
          "#CarTypeBSMotor6{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeCXMotor4->setStyleSheet(
          //设置普通状态样式
          "#CarTypeCXMotor4:focus{outline: none;}"
          "#CarTypeCXMotor4{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeDCXMotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeDCXMotor3:focus{outline: none;}"
          "#CarTypeDCXMotor3{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeMBmotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeMBmotor3:focus{outline: none;}"
          "#CarTypeMBmotor3{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeBZDMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBZDMotor6:focus{outline: none;}"
          "#CarTypeBZDMotor6{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
  }
  else if(CarTypeMode == 2)
  {
    ui.CarTypeBSMotor5->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor5:focus{outline: none;}"
          "#CarTypeBSMotor5{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );

    ui.CarTypeBSMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor6:focus{outline: none;}"
          "#CarTypeBSMotor6{"
          "background-image:url(:/image/chache/bulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeCXMotor4->setStyleSheet(
          //设置普通状态样式
          "#CarTypeCXMotor4:focus{outline: none;}"
          "#CarTypeCXMotor4{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeDCXMotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeDCXMotor3:focus{outline: none;}"
          "#CarTypeDCXMotor3{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeMBmotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeMBmotor3:focus{outline: none;}"
          "#CarTypeMBmotor3{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeBZDMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBZDMotor6:focus{outline: none;}"
          "#CarTypeBZDMotor6{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
  }
  else if(CarTypeMode == 3)
  {
    ui.CarTypeBSMotor5->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor5:focus{outline: none;}"
          "#CarTypeBSMotor5{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );

    ui.CarTypeBSMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor6:focus{outline: none;}"
          "#CarTypeBSMotor6{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeCXMotor4->setStyleSheet(
          //设置普通状态样式
          "#CarTypeCXMotor4:focus{outline: none;}"
          "#CarTypeCXMotor4{"
          "background-image:url(:/image/chache/bulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeDCXMotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeDCXMotor3:focus{outline: none;}"
          "#CarTypeDCXMotor3{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeMBmotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeMBmotor3:focus{outline: none;}"
          "#CarTypeMBmotor3{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeBZDMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBZDMotor6:focus{outline: none;}"
          "#CarTypeBZDMotor6{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
  }
  else if(CarTypeMode == 4)
  {
    ui.CarTypeBSMotor5->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor5:focus{outline: none;}"
          "#CarTypeBSMotor5{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );

    ui.CarTypeBSMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor6:focus{outline: none;}"
          "#CarTypeBSMotor6{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeCXMotor4->setStyleSheet(
          //设置普通状态样式
          "#CarTypeCXMotor4:focus{outline: none;}"
          "#CarTypeCXMotor4{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeDCXMotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeDCXMotor3:focus{outline: none;}"
          "#CarTypeDCXMotor3{"
          "background-image:url(:/image/chache/bulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeMBmotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeMBmotor3:focus{outline: none;}"
          "#CarTypeMBmotor3{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeBZDMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBZDMotor6:focus{outline: none;}"
          "#CarTypeBZDMotor6{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
  }
  else if(CarTypeMode == 5)
  {
    ui.CarTypeBSMotor5->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor5:focus{outline: none;}"
          "#CarTypeBSMotor5{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );

    ui.CarTypeBSMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor6:focus{outline: none;}"
          "#CarTypeBSMotor6{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeCXMotor4->setStyleSheet(
          //设置普通状态样式
          "#CarTypeCXMotor4:focus{outline: none;}"
          "#CarTypeCXMotor4{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeDCXMotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeDCXMotor3:focus{outline: none;}"
          "#CarTypeDCXMotor3{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeMBmotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeMBmotor3:focus{outline: none;}"
          "#CarTypeMBmotor3{"
          "background-image:url(:/image/chache/bulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeBZDMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBZDMotor6:focus{outline: none;}"
          "#CarTypeBZDMotor6{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
  }
  else if(CarTypeMode == 6)
  {
    ui.CarTypeBSMotor5->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor5:focus{outline: none;}"
          "#CarTypeBSMotor5{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );

    ui.CarTypeBSMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBSMotor6:focus{outline: none;}"
          "#CarTypeBSMotor6{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeCXMotor4->setStyleSheet(
          //设置普通状态样式
          "#CarTypeCXMotor4:focus{outline: none;}"
          "#CarTypeCXMotor4{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeDCXMotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeDCXMotor3:focus{outline: none;}"
          "#CarTypeDCXMotor3{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeMBmotor3->setStyleSheet(
          //设置普通状态样式
          "#CarTypeMBmotor3:focus{outline: none;}"
          "#CarTypeMBmotor3{"
          "background-image:url(:/image/chache/lightbulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
    ui.CarTypeBZDMotor6->setStyleSheet(
          //设置普通状态样式
          "#CarTypeBZDMotor6:focus{outline: none;}"
          "#CarTypeBZDMotor6{"
          "background-image:url(:/image/chache/bulebtn.png);"
          "background-color:rgb(255,255,255,200);"      //背景颜色和透明度
          "color:rgb(255,255,255);"                            //字体颜色
          "border-radius:10px;"                           //边框圆角
  //        "border: 3px outset rgb(128,128,128);"         //边框宽度、样式以及颜色
           "font-size:24pt;"                              //字体类型和字体大小
           "text-align: center;"
          "}"
          );
  }
}

void MainWindow::showSystemBtn()
{
  if(sensorStatus == 1)
  {
    ui.ChangeType1->setIcon(QIcon(":/image/chache/para1-2.png"));
    ui.ChangeType1->setIconSize(QSize(217,67));

    ui.ChangeType2->setIcon(QIcon(":/image/chache/para3-1.png"));
    ui.ChangeType2->setIconSize(QSize(217,67));

    ui.ChangeType3->setIcon(QIcon(":/image/chache/para2-1.png"));
    ui.ChangeType3->setIconSize(QSize(217,67));

    ui.ChangeType4->setIcon(QIcon(":/image/chache/para4-1.png"));
    ui.ChangeType4->setIconSize(QSize(217,67));
  }
  else if(sensorStatus == 2)
  {
    ui.ChangeType1->setIcon(QIcon(":/image/chache/para1-1.png"));
    ui.ChangeType1->setIconSize(QSize(217,67));

    ui.ChangeType2->setIcon(QIcon(":/image/chache/para3-2.png"));
    ui.ChangeType2->setIconSize(QSize(217,67));

    ui.ChangeType3->setIcon(QIcon(":/image/chache/para2-1.png"));
    ui.ChangeType3->setIconSize(QSize(217,67));

    ui.ChangeType4->setIcon(QIcon(":/image/chache/para4-1.png"));
    ui.ChangeType4->setIconSize(QSize(217,67));
  }
  else if(sensorStatus == 3)
  {
//    qDebug("sensorstatus = 3");
    ui.ChangeType1->setIcon(QIcon(":/image/chache/para1-1.png"));
    ui.ChangeType1->setIconSize(QSize(217,67));

    ui.ChangeType2->setIcon(QIcon(":/image/chache/para3-1.png"));
    ui.ChangeType2->setIconSize(QSize(217,67));

    ui.ChangeType3->setIcon(QIcon(":/image/chache/para2-2.png"));
    ui.ChangeType3->setIconSize(QSize(217,67));

    ui.ChangeType4->setIcon(QIcon(":/image/chache/para4-1.png"));
    ui.ChangeType4->setIconSize(QSize(217,67));
  }
  else if(sensorStatus == 4)
  {
    ui.ChangeType1->setIcon(QIcon(":/image/chache/para1-1.png"));
    ui.ChangeType1->setIconSize(QSize(217,67));

    ui.ChangeType2->setIcon(QIcon(":/image/chache/para3-1.png"));
    ui.ChangeType2->setIconSize(QSize(217,67));

    ui.ChangeType3->setIcon(QIcon(":/image/chache/para2-1.png"));
    ui.ChangeType3->setIconSize(QSize(217,67));

    ui.ChangeType4->setIcon(QIcon(":/image/chache/para4-2.png"));
    ui.ChangeType4->setIconSize(QSize(217,67));
  }
}

void MainWindow::on_ChangeType1_clicked()
{
  setSensorStatus(1);

  QString word_str;
  word_str = QString::fromLocal8Bit("修改参数为默认值!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_ChangeType2_clicked()
{
  setSensorStatus(2);

  QString word_str;
  word_str = QString::fromLocal8Bit("修改参数为关闭防撞条!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_ChangeType3_clicked()
{
  setSensorStatus(3);

  QString word_str;
  word_str = QString::fromLocal8Bit("修改参数为关闭传感器!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_ChangeType4_clicked()
{
  setSensorStatus(4);

  QString word_str;
  word_str = QString::fromLocal8Bit("修改参数为全部关闭!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::AlarmHandle()
{
  QString word_str;
  QPalette color;
  QFont font;

  if((rtu317.in.ch.bit3_swCloseLimit == 1 || rtu317.in.ch.bit5_swClose == 1) &&
     (rtu317.in.ch.bit2_swOpenLimit == 1 || rtu317.in.ch.bit4_swOpen == 1))
  {
//    font.setPointSize(WORD_SIZE);
//    word_str = QString::fromLocal8Bit("到位、极限传感器报警");
//    ui.AlarmHandleLa->setFont(font);
//    ui.AlarmHandleLa->setText(QString(word_str));                //显示页数
//    ui.AlarmHandleLa->setAlignment(Qt::AlignCenter);
//    color.setColor(QPalette::WindowText,Qt::red);
//    ui.AlarmHandleLa->setPalette(color);
//    AlarmHandle_status = 1;
//  }
//  else if((rtu317.in.ch.bit3_swCloseLimit == 1 || rtu317.in.ch.bit5_swClose == 1) &&
//          rtu317.in.ch.bit6_swTouch == 1)
//  {
//    font.setPointSize(WORD_SIZE);
//    word_str = QString::fromLocal8Bit("筒位触发、传感器缩回极限警报");
//    ui.AlarmHandleLa->setFont(font);
//    ui.AlarmHandleLa->setText(QString(word_str));                //显示页数
//    ui.AlarmHandleLa->setAlignment(Qt::AlignCenter);
//    color.setColor(QPalette::WindowText,Qt::green);
//    ui.AlarmHandleLa->setPalette(color);
//    AlarmHandle_status = 2;
//  }
//  else
//  {
//    font.setPointSize(WORD_SIZE);
//    word_str = QString::fromLocal8Bit("无警报");
//    ui.AlarmHandleLa->setFont(font);
//    ui.AlarmHandleLa->setText(QString(word_str));                //显示页数
//    ui.AlarmHandleLa->setAlignment(Qt::AlignCenter);
//    color.setColor(QPalette::WindowText,Qt::green);
//    ui.AlarmHandleLa->setPalette(color);
//    AlarmHandle_status = 0;
  }
}

//添加自动创建log文件夹
bool MainWindow::LogDirExist(QString fullPath)
{
    QDir dir(fullPath);
    if(dir.exists())
    {
        //存在当前文件夹
      qDebug("目录存在");
        return true;
    }
    else
    {
        //不存在则创建
        bool ok = dir.mkdir(fullPath); //只创建一级子目录，即必须保证上级目录存在
        qDebug("目录bubububu存在");
        return ok;
    }
}

void MainWindow::on_SaftyRadar11_Cotton_pressed()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.SaftyRadar11_Cotton_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.SaftyRadar11_Cotton_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_SaftyRadar11_Cotton_released()
{
  if(Radar_Area1 < 3 && Radar_Area1 >= 0)
  {
    Radar_Area1 = Radar_Area1 + 1;
    errmask_Cotton_.mask.b.radarArea101 = Radar_Area1;
    errmask_Cotton_.mask.b.radarArea201 = 0;
  }
  else if(Radar_Area1 == 3)
  {
    Radar_Area1 = 0;
    errmask_Cotton_.mask.b.radarArea101 = 0;
    errmask_Cotton_.mask.b.radarArea201 = 0;
  }

  qnode.errmask_send_.mask = errmask_Cotton_.mask.data;
  qnode.errmaskSendPublish(qnode.errmask_send_);

  QImage img(":/image/chache/bulebtn.png");
  QImage scalimg = img.scaled(ui.SaftyRadar11_Cotton_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.SaftyRadar11_Cotton_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WARNING_WORD_SIZE_20);
  word_str1 = QString::number(Radar_Area1);
  ui.SaftyRadar11_Cotton_label->setFont(font);
  ui.SaftyRadar11_Cotton_label->setText(QString(word_str1));                //显示页数
  ui.SaftyRadar11_Cotton_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.SaftyRadar11_Cotton_label->setPalette(color);
}

void MainWindow::on_SaftyRadar21_Cotton_pressed()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.SaftyRadar21_Cotton_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.SaftyRadar21_Cotton_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_SaftyRadar21_Cotton_released()
{
  if(Radar_Area2 < 3 && Radar_Area2 >= 0)
  {
    Radar_Area2 = Radar_Area2 + 1;
    errmask_Cotton_.mask.b.radarArea201 = Radar_Area2;
    errmask_Cotton_.mask.b.radarArea101 = 0;
  }
  else if(Radar_Area2 == 3)
  {
    Radar_Area2 = 0;
    errmask_Cotton_.mask.b.radarArea201 = 0;
    errmask_Cotton_.mask.b.radarArea101 = 0;
  }

  qnode.errmask_send_.mask = errmask_Cotton_.mask.data;
  qnode.errmaskSendPublish(qnode.errmask_send_);

  QImage img(":/image/chache/bulebtn.png");
  QImage scalimg = img.scaled(ui.SaftyRadar21_Cotton_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.SaftyRadar21_Cotton_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WARNING_WORD_SIZE_20);
  word_str1 = QString::number(Radar_Area2);
  ui.SaftyRadar21_Cotton_label->setFont(font);
  ui.SaftyRadar21_Cotton_label->setText(QString(word_str1));                //显示页数
  ui.SaftyRadar21_Cotton_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.SaftyRadar21_Cotton_label->setPalette(color);
}

void MainWindow::on_ImpactControl_Cotton_clicked()
{
  errmask_Cotton_.mask.b.impact = 1;
  errmask_Cotton_.mask.b.radarArea101 = 0;
  errmask_Cotton_.mask.b.radarArea201 = 0;

  ui.ImpactControl_Cotton->setIcon(QIcon(":/image/chache/OpenGreen.png"));
  ui.ImpactControl_2_Cotton->setIcon(QIcon(":/image/chache/CloseBlue.png"));

  qnode.errmask_send_.mask = errmask_Cotton_.mask.data;
  qnode.errmaskSendPublish(qnode.errmask_send_);
}

void MainWindow::on_ImpactControl_2_Cotton_clicked()
{
  errmask_Cotton_.mask.b.impact = 0;
  errmask_Cotton_.mask.b.radarArea101 = 0;
  errmask_Cotton_.mask.b.radarArea201 = 0;

  ui.ImpactControl_Cotton->setIcon(QIcon(":/image/chache/OpenBlue.png"));
  ui.ImpactControl_2_Cotton->setIcon(QIcon(":/image/chache/CloseRed.png"));

  qnode.errmask_send_.mask = errmask_Cotton_.mask.data;
  qnode.errmaskSendPublish(qnode.errmask_send_);
}

void MainWindow::on_ChargingOpen_Cotton_pressed()
{
  ui.ChargingOpen_Cotton->setIcon(QIcon(":/image/chache/OpenGreen.png"));
}

void MainWindow::on_ChargingOpen_Cotton_released()
{
//  if(control_send_re_.sw.b.charging == 0)
  {
//    control_send_re_.sw.b.charging = 1;
    ui.ChargingOpen_Cotton->setIcon(QIcon(":/image/chache/OpenGreen.png"));
//    ui.ChargingClose_Cotton->setIcon(QIcon(":/image/chache/CloseBlue.png"));
  }
//  else
//  {
//    control_send_re_.sw.b.charging = 0;
//    ui.ChargingOpen_Cotton->setIcon(QIcon(":/image/chache/CloseBtn.png"));
//  }

  qnode.self_task_cmd_send_.cmd = 3;

  qnode.selfTaskSendPublish(qnode.self_task_cmd_send_);
}

void MainWindow::on_ChargingClose_Cotton_pressed()
{
  ui.ChargingClose_Cotton->setIcon(QIcon(":/image/chache/CloseBlue.png"));
}

void MainWindow::on_ChargingClose_Cotton_released()
{
//  if(control_send_re_.sw.b.charging == 0)
//  {
//    control_send_re_.sw.b.charging = 1;
//    ui.ChargingOpen_Cotton->setIcon(QIcon(":/image/chache/OpenBtn.png"));
//  }
//  else
  {
//    control_send_re_.sw.b.charging = 0;
//    ui.ChargingOpen_Cotton->setIcon(QIcon(":/image/chache/OpenBlue.png"));
    ui.ChargingClose_Cotton->setIcon(QIcon(":/image/chache/CloseRed.png"));
  }

  qnode.self_task_cmd_send_.cmd = 4;

  qnode.selfTaskSendPublish(qnode.self_task_cmd_send_);
}


void MainWindow::on_OpenNet_2_pressed()
{
  QImage img(":/image/chache/NetCheckgreen.png");
  QImage scalimg = img.scaled(ui.OpenNet_2_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.OpenNet_2_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_OpenNet_2_released()
{
  QImage img(":/image/chache/NetCheckblue.png");
  QImage scalimg = img.scaled(ui.OpenNet_2_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.OpenNet_2_label->setPixmap(QPixmap::fromImage(scalimg));

  QString http = "http://";
//  QString IP1 = "192.168.0.1";
//  QString index = "/pb/#/";
  QString app = http + getNetIP;

  QDesktopServices::openUrl(QUrl(app));
}

//棉包叉车示廓灯
void MainWindow::on_LightBtn_Cotton_clicked()
{
  if(control_send_re_.sw.b.safeLamp == 0)
  {
    control_send_re_.sw.b.safeLamp = 1;
    ui.LightBtn_Cotton->setIcon(QIcon(":/image/chache/OpenBtn.png"));
  }
  else
  {
    control_send_re_.sw.b.safeLamp = 0;
    ui.LightBtn_Cotton->setIcon(QIcon(":/image/chache/CloseBtn.png"));
  }

  qnode.control_info_send_.lamp = 1;
  qnode.control_info_send_.horn = 1;
  qnode.control_info_send_.sw = control_send_re_.sw.data;
  qnode.controlSendPublish(qnode.control_info_send_);
}

//叉车示廓灯
void MainWindow::on_LightBtn_fork_clicked()
{
  if(control_send_re_.sw.b.safeLamp == 0)
  {
    control_send_re_.sw.b.safeLamp = 1;
    ui.LightBtn_fork->setIcon(QIcon(":/image/chache/OpenBtn.png"));
  }
  else
  {
    control_send_re_.sw.b.safeLamp = 0;
    ui.LightBtn_fork->setIcon(QIcon(":/image/chache/CloseBtn.png"));
  }

  qnode.control_info_send_.lamp = 1;
  qnode.control_info_send_.horn = 1;
  qnode.control_info_send_.sw = control_send_re_.sw.data;
  qnode.controlSendPublish(qnode.control_info_send_);
}

//首页取消定位按钮
void MainWindow::on_CancelPosition_pressed()
{
  ui.CancelPosition->setIcon(QIcon(":/image/4dai/positionclose.png"));
  ui.CancelPosition->setIconSize(QSize(216,67));
}

void MainWindow::on_CancelPosition_released()
{
  ui.CancelPosition->setIcon(QIcon(":/image/4dai/positioncloseblue.png"));
  ui.CancelPosition->setIconSize(QSize(216,67));

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 2;
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("操作退出定位按钮!!!");
  errorLocalLogInfoDecode(word_str);

}

//首页启动点定位按钮/充电点定位
void MainWindow::on_FixPosition_pressed()
{
//  ui.FixPosition->setIcon(QIcon(":/image/4dai/position.png"));
//  ui.FixPosition->setIconSize(QSize(216,67));
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_released()
{
//  ui.FixPosition->setIcon(QIcon(":/image/4dai/positionblue.png"));
//  ui.FixPosition->setIconSize(QSize(216,67));

//  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
//  int timeT = time1.toTime_t();   //将当前时间转为时间戳

//  qnode.quick_fixed_position_send_.cmd_id = timeT;
//  qnode.quick_fixed_position_send_.cmd = 1;
//  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

//  QString word_str;
//  word_str = QString::fromLocal8Bit("操作启动点定位按钮!!!");
//  errorLocalLogInfoDecode(word_str);
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WARNING_WORD_SIZE_26);
  word_str1 = QString::fromLocal8Bit("充电点定位");
  ui.FixPosition_label->setFont(font);
  ui.FixPosition_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_label->setPalette(color);

    QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
    int timeT = time1.toTime_t();   //将当前时间转为时间戳

    qnode.quick_fixed_position_send_.cmd_id = timeT;
    qnode.quick_fixed_position_send_.cmd = 1;
    qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

    QString word_str;
    word_str = QString::fromLocal8Bit("在充电点定位!!!");
    errorLocalLogInfoDecode(word_str);

//  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
//  int timeT = time1.toTime_t();   //将当前时间转为时间戳

//  qnode.quick_fixed_position_send_.cmd_id = timeT;
//  qnode.quick_fixed_position_send_.cmd = 3;
//  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[10][0];
//  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[10][1];
//  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[10][2];
//  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

//  QString word_str;
//  word_str = QString::fromLocal8Bit("在充电点定位!!!");
//  errorLocalLogInfoDecode(word_str);
}

//第1定位点定位
void MainWindow::on_FixPosition_2_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_2_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_2_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_2_released()
{
//  ui.FixPosition_2->setIcon(QIcon(":/image/chache/lightbulebtn.png"));
//  ui.FixPosition_2->setIconSize(QSize(216,67));

  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_2_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_2_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点1");
  ui.FixPosition_2_label->setFont(font);
  ui.FixPosition_2_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_2_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_2_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[0][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[0][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[0][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第一定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}

//第2定位点定位
void MainWindow::on_FixPosition_3_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_3_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_3_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_3_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_3_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_3_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点2");
  ui.FixPosition_3_label->setFont(font);
  ui.FixPosition_3_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_3_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_3_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[1][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[1][1];
    qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[1][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第二定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}

//第3定位点定位
void MainWindow::on_FixPosition_4_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_4_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_4_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_4_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_4_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_4_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点3");
  ui.FixPosition_4_label->setFont(font);
  ui.FixPosition_4_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_4_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_4_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[2][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[2][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[2][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第三定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}

//第4定位点定位
void MainWindow::on_FixPosition_5_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_5_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_5_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_5_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_5_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_5_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点4");
  ui.FixPosition_5_label->setFont(font);
  ui.FixPosition_5_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_5_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_5_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[3][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[3][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[3][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第四定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_FixPosition_6_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_6_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_6_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_6_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_6_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_6_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点5");
  ui.FixPosition_6_label->setFont(font);
  ui.FixPosition_6_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_6_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_6_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[4][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[4][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[4][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第五定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_FixPosition_7_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_7_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_7_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_7_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_7_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_7_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点6");
  ui.FixPosition_7_label->setFont(font);
  ui.FixPosition_7_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_7_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_7_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[5][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[5][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[5][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第六定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_FixPosition_8_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_8_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_8_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_8_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_8_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_8_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点7");
  ui.FixPosition_8_label->setFont(font);
  ui.FixPosition_8_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_8_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_8_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[6][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[6][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[6][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第七定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}

void gui::MainWindow::on_FixPosition_9_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_9_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_9_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_9_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_9_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_9_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点A");
  ui.FixPosition_9_label->setFont(font);
  ui.FixPosition_9_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_9_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_9_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[7][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[7][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[7][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第A定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_FixPosition_10_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_10_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_10_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_10_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_9_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_10_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点B");
  ui.FixPosition_10_label->setFont(font);
  ui.FixPosition_10_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_10_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_10_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[8][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[8][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[8][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第B定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_FixPosition_11_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_11_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_11_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_11_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_9_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_11_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点C");
  ui.FixPosition_11_label->setFont(font);
  ui.FixPosition_11_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_11_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_11_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[9][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[9][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[9][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第C定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}

void MainWindow::on_FixPosition_12_pressed()
{
//  QImage img(":/image/chache/longgreen.png");
//  QImage scalimg = img.scaled(ui.FixPosition_12_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
//  ui.FixPosition_12_label->setPixmap(QPixmap::fromImage(scalimg));
  ui.FixPosition_12->setIcon(QIcon(":/image/4dai/position.png"));
  ui.FixPosition_12->setIconSize(QSize(216,67));
}

void MainWindow::on_FixPosition_12_released()
{
//  QImage img(":/image/chache/lightbulebtn.png");
//  QImage scalimg = img.scaled(ui.FixPosition_12_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
//  ui.FixPosition_12_label->setPixmap(QPixmap::fromImage(scalimg));

//  QString word_str1;
//  QPalette color;
//  QFont font;

//  font.setPointSize(WORD_SIZE);
//  word_str1 = QString::fromLocal8Bit("充电点定位");
//  ui.FixPosition_12_label->setFont(font);
//  ui.FixPosition_12_label->setText(QString(word_str1));                //显示页数
//  ui.FixPosition_12_label->setAlignment(Qt::AlignCenter);
//  color.setColor(QPalette::WindowText,Qt::white);
//  ui.FixPosition_12_label->setPalette(color);

//  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
//  int timeT = time1.toTime_t();   //将当前时间转为时间戳

//  qnode.quick_fixed_position_send_.cmd_id = timeT;
//  qnode.quick_fixed_position_send_.cmd = 3;
//  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[10][0];
//  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[10][1];
//  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[10][2];
//  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

//  QString word_str;
//  word_str = QString::fromLocal8Bit("在充电点定位!!");
//  errorLocalLogInfoDecode(word_str);

  ui.FixPosition_12->setIcon(QIcon(":/image/4dai/positionblue.png"));
  ui.FixPosition_12->setIconSize(QSize(216,67));

    QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
    int timeT = time1.toTime_t();   //将当前时间转为时间戳

    qnode.quick_fixed_position_send_.cmd_id = timeT;
    qnode.quick_fixed_position_send_.cmd = 3;
    qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[10][0];
    qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[10][1];
    qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[10][2];
    qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

    QString word_str;
    word_str = QString::fromLocal8Bit("操作停靠点定位按钮!!");
    errorLocalLogInfoDecode(word_str);

//  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
//  int timeT = time1.toTime_t();   //将当前时间转为时间戳

//  qnode.quick_fixed_position_send_.cmd_id = timeT;
//  qnode.quick_fixed_position_send_.cmd = 1;
//  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

//  QString word_str;
//  word_str = QString::fromLocal8Bit("操作启动点定位按钮!!!");
//  errorLocalLogInfoDecode(word_str);
}

//叉车第1定位点
void MainWindow::on_FixPosition_13_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_13_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_13_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_13_released()
{
//  ui.FixPosition_2->setIcon(QIcon(":/image/chache/lightbulebtn.png"));
//  ui.FixPosition_2->setIconSize(QSize(216,67));

  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_13_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_13_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点1");
  ui.FixPosition_13_label->setFont(font);
  ui.FixPosition_13_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_13_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_13_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[0][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[0][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[0][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第一定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}

//第2定位点定位
void MainWindow::on_FixPosition_14_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_14_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_14_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_14_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_14_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_14_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点2");
  ui.FixPosition_14_label->setFont(font);
  ui.FixPosition_14_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_14_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_14_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[1][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[1][1];
    qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[1][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第二定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}
//叉车第3定位点
void MainWindow::on_FixPosition_15_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_15_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_15_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_15_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_15_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_15_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点3");
  ui.FixPosition_15_label->setFont(font);
  ui.FixPosition_15_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_15_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_15_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[2][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[2][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[2][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第三定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}
//叉车第4定位点
void MainWindow::on_FixPosition_16_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_16_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_16_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_16_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_16_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_16_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点4");
  ui.FixPosition_16_label->setFont(font);
  ui.FixPosition_16_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_16_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_16_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[3][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[3][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[3][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第四定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}
//叉车第5定位点
void MainWindow::on_FixPosition_17_pressed()
{
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.FixPosition_17_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_17_label->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_FixPosition_17_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.FixPosition_17_label->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.FixPosition_17_label->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WORD_SIZE);
  word_str1 = QString::fromLocal8Bit("定位点5");
  ui.FixPosition_17_label->setFont(font);
  ui.FixPosition_17_label->setText(QString(word_str1));                //显示页数
  ui.FixPosition_17_label->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.FixPosition_17_label->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.quick_fixed_position_send_.cmd_id = timeT;
  qnode.quick_fixed_position_send_.cmd = 3;
  qnode.quick_fixed_position_send_.position_x = positon_point_coordinate[4][0];
  qnode.quick_fixed_position_send_.position_y = positon_point_coordinate[4][1];
  qnode.quick_fixed_position_send_.position_angle = positon_point_coordinate[4][2];
  qnode.quickFixedPositionSendPublish(qnode.quick_fixed_position_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("在第五定位点定位!!!");
  errorLocalLogInfoDecode(word_str);
}


//操作任务取消按钮
void MainWindow::on_CancelTask_pressed()
{
  ui.CancelTask->setIcon(QIcon(":/image/4dai/canceltask.png"));
  ui.CancelTask->setIconSize(QSize(216,67));
}

void MainWindow::on_CancelTask_released()
{
  ui.CancelTask->setIcon(QIcon(":/image/4dai/cancetaskblue.png"));
  ui.CancelTask->setIconSize(QSize(216,67));

  qnode.mission_cancel_send_.cmd = 1;
  qnode.missionCancelSendCallback(qnode.mission_cancel_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("操作任务取消按钮!!!");
  errorLocalLogInfoDecode(word_str);
}

//操作首页刹车按钮
void MainWindow::on_ManualBrake_pressed()
{
//  ui.ManualBrake->setIcon(QIcon(":/image/4dai/brakebtngreen.png"));
//  ui.ManualBrake->setIconSize(QSize(107,64));

  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.ManualBrake_La->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.ManualBrake_La->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_ManualBrake_released()
{
  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.ManualBrake_La->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.ManualBrake_La->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WARNING_WORD_SIZE_26);
  word_str1 = QString::fromLocal8Bit("刹车");
  ui.ManualBrake_La->setFont(font);
  ui.ManualBrake_La->setText(QString(word_str1));                //显示页数
  ui.ManualBrake_La->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.ManualBrake_La->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.robot_pause_send_.cmd_id = timeT;
  qnode.robot_pause_send_.cmd = 1;
  qnode.robotPauseSendCallback(qnode.robot_pause_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("操作首页刹车按钮!!!");
  errorLocalLogInfoDecode(word_str);
}

//操作首页恢复按钮
void MainWindow::on_ManualRecover_pressed()
{
//  ui.ManualRecover->setIcon(QIcon(":/image/4dai/recoverbtngreen.png"));
//  ui.ManualRecover->setIconSize(QSize(107,64));
  QImage img(":/image/chache/longgreen.png");
  QImage scalimg = img.scaled(ui.ManualRecover_La->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.ManualRecover_La->setPixmap(QPixmap::fromImage(scalimg));
}

void MainWindow::on_ManualRecover_released()
{
//  ui.ManualRecover->setIcon(QIcon(":/image/4dai/recoverbtnblue.png"));
//  ui.ManualRecover->setIconSize(QSize(107,64));

  QImage img(":/image/chache/lightbulebtn.png");
  QImage scalimg = img.scaled(ui.ManualRecover_La->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
  ui.ManualRecover_La->setPixmap(QPixmap::fromImage(scalimg));

  QString word_str1;
  QPalette color;
  QFont font;

  font.setPointSize(WARNING_WORD_SIZE_26);
  word_str1 = QString::fromLocal8Bit("恢复");
  ui.ManualRecover_La->setFont(font);
  ui.ManualRecover_La->setText(QString(word_str1));                //显示页数
  ui.ManualRecover_La->setAlignment(Qt::AlignCenter);
  color.setColor(QPalette::WindowText,Qt::white);
  ui.ManualRecover_La->setPalette(color);

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.robot_pause_send_.cmd_id = timeT;
  qnode.robot_pause_send_.cmd = 0;
  qnode.robotPauseSendCallback(qnode.robot_pause_send_);

  QString word_str;
  word_str = QString::fromLocal8Bit("操作首页恢复按钮!!!");
  errorLocalLogInfoDecode(word_str);
}

//滑轨推杆伸出/
void MainWindow::on_ArmPushBtn_pressed()
{
  ui.ArmPushBtn->setIcon(QIcon(":/image/zidingyi/pushgreen.png"));
  ui.ArmPushBtn->setIconSize(QSize(161,51));
}

void MainWindow::on_ArmPushBtn_released()
{
  ui.ArmPushBtn->setIcon(QIcon(":/image/zidingyi/pushblue.png"));
  ui.ArmPushBtn->setIconSize(QSize(161,51));

//  Q_EMIT ArmOpenCmdSend(1);
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.arm_cmd_send_.cmd_id = timeT;
  qnode.arm_cmd_send_.cmd = 103;
  qnode.armcmdSendPublish(qnode.arm_cmd_send_);


//    qnode.qt_up_down_send_.cmd_id = timeT;
//    qnode.qt_up_down_send_.cmd = 1;
//    qnode.qt_up_down_send_.mode = 1;
//    qnode.qt_up_down_send_.param = 101;
//    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
}

//滑轨推杆缩回
void MainWindow::on_ArmPullBtn_pressed()
{
  ui.ArmPullBtn->setIcon(QIcon(":/image/zidingyi/pullgreen.png"));
  ui.ArmPullBtn->setIconSize(QSize(161,51));
}

void MainWindow::on_ArmPullBtn_released()
{
  ui.ArmPullBtn->setIcon(QIcon(":/image/zidingyi/pullblue.png"));
  ui.ArmPullBtn->setIconSize(QSize(161,51));

//  Q_EMIT ArmOpenCmdSend(1);
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.arm_cmd_send_.cmd_id = timeT;
  qnode.arm_cmd_send_.cmd = 104;
  qnode.armcmdSendPublish(qnode.arm_cmd_send_);

//    qnode.qt_up_down_send_.cmd_id = timeT;
//    qnode.qt_up_down_send_.cmd = 1;
//    qnode.qt_up_down_send_.mode = 1;
//    qnode.qt_up_down_send_.param = 102;
//    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
}

//
void MainWindow::on_ArmPullPushBtn_pressed()
{
  ui.ArmPullPushBtn->setIcon(QIcon(":/image/4dai/pausearmgreen.png"));
  ui.ArmPullPushBtn->setIconSize(QSize(161,51));
}

void MainWindow::on_ArmPullPushBtn_released()
{
  ui.ArmPullPushBtn->setIcon(QIcon(":/image/4dai/pausearmred.png"));
  ui.ArmPullPushBtn->setIconSize(QSize(161,51));

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.arm_cmd_send_.cmd_id = timeT;
  qnode.arm_cmd_send_.cmd = 100;
  qnode.armcmdSendPublish(qnode.arm_cmd_send_);

//    qnode.qt_up_down_send_.cmd_id = timeT;
//    qnode.qt_up_down_send_.cmd = 1;
//    qnode.qt_up_down_send_.mode = 1;
//    qnode.qt_up_down_send_.param = 200;
//    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
}

void MainWindow::on_ArmPutBtn_pressed()
{
  ui.ArmPutBtn->setIcon(QIcon(":/image/zidingyi/pushgreen.png"));
  ui.ArmPutBtn->setIconSize(QSize(161,51));
}

//直流电推杆伸出
void MainWindow::on_ArmPutBtn_released()
{
  ui.ArmPutBtn->setIcon(QIcon(":/image/zidingyi/pushblue.png"));
  ui.ArmPutBtn->setIconSize(QSize(161,51));

//  Q_EMIT ArmOpenCmdSend(1);
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.arm_cmd_send_.cmd_id = timeT;
  qnode.arm_cmd_send_.cmd = 105;
  qnode.armcmdSendPublish(qnode.arm_cmd_send_);

//    qnode.qt_up_down_send_.cmd_id = timeT;
//    qnode.qt_up_down_send_.cmd = 2;
//    qnode.qt_up_down_send_.mode = 1;
//    qnode.qt_up_down_send_.param = 101;
//    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
}

//直流电推杆缩回
void MainWindow::on_ArmGetBtn_pressed()
{
  ui.ArmGetBtn->setIcon(QIcon(":/image/zidingyi/pullgreen.png"));
  ui.ArmGetBtn->setIconSize(QSize(161,51));
}

void MainWindow::on_ArmGetBtn_released()
{
  ui.ArmGetBtn->setIcon(QIcon(":/image/zidingyi/pullblue.png"));
  ui.ArmGetBtn->setIconSize(QSize(161,51));

//  Q_EMIT ArmOpenCmdSend(1);
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.arm_cmd_send_.cmd_id = timeT;
  qnode.arm_cmd_send_.cmd = 106;
  qnode.armcmdSendPublish(qnode.arm_cmd_send_);

//    qnode.qt_up_down_send_.cmd_id = timeT;
//    qnode.qt_up_down_send_.cmd = 2;
//    qnode.qt_up_down_send_.mode = 1;
//    qnode.qt_up_down_send_.param = 102;
//    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
}

void MainWindow::on_ArmPutGetBtn_pressed()
{
  ui.ArmPutGetBtn->setIcon(QIcon(":/image/4dai/pausearmgreen.png"));
  ui.ArmPutGetBtn->setIconSize(QSize(161,51));
}

void MainWindow::on_ArmPutGetBtn_released()
{
  ui.ArmPutGetBtn->setIcon(QIcon(":/image/4dai/pausearmred.png"));
  ui.ArmPutGetBtn->setIconSize(QSize(161,51));

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

  qnode.arm_cmd_send_.cmd_id = timeT;
  qnode.arm_cmd_send_.cmd = 100;
  qnode.armcmdSendPublish(qnode.arm_cmd_send_);

//    qnode.qt_up_down_send_.cmd_id = timeT;
//    qnode.qt_up_down_send_.cmd = 2;
//    qnode.qt_up_down_send_.mode = 1;
//    qnode.qt_up_down_send_.param = 200;
//    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
}

void MainWindow::on_ArmGuradGetBtn_pressed()
{
  ui.ArmGuradGetBtn->setIcon(QIcon(":/image/zidingyi/guardgetgreen.png"));
  ui.ArmGuradGetBtn->setIconSize(QSize(161,51));
}

void MainWindow::on_ArmGuradGetBtn_released()
{
  ui.ArmGuradGetBtn->setIcon(QIcon(":/image/zidingyi/guardgetblue.png"));
  ui.ArmGuradGetBtn->setIconSize(QSize(161,51));

//  Q_EMIT ArmOpenCmdSend(1);
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

//  qnode.arm_cmd_send_.cmd_id = timeT;
//  qnode.arm_cmd_send_.cmd = 101;
//  qnode.armcmdSendPublish(qnode.arm_cmd_send_);


    qnode.qt_up_down_send_.cmd_id = timeT;
    qnode.qt_up_down_send_.cmd = 9;
    qnode.qt_up_down_send_.mode = 1;
    qnode.qt_up_down_send_.param = 101;
    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
}

void MainWindow::on_ArmGuradPutBtn_pressed()
{
  ui.ArmGuradPutBtn->setIcon(QIcon(":/image/zidingyi/guardputgreen.png"));
  ui.ArmGuradPutBtn->setIconSize(QSize(161,51));
}

void MainWindow::on_ArmGuradPutBtn_released()
{
  ui.ArmGuradPutBtn->setIcon(QIcon(":/image/zidingyi/guardputblue.png"));
  ui.ArmGuradPutBtn->setIconSize(QSize(161,51));

//  Q_EMIT ArmOpenCmdSend(1);
  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

//  qnode.arm_cmd_send_.cmd_id = timeT;
//  qnode.arm_cmd_send_.cmd = 101;
//  qnode.armcmdSendPublish(qnode.arm_cmd_send_);


    qnode.qt_up_down_send_.cmd_id = timeT;
    qnode.qt_up_down_send_.cmd = 9;
    qnode.qt_up_down_send_.mode = 1;
    qnode.qt_up_down_send_.param = 102;
    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
}

void MainWindow::on_ArmGuradGetPutBtn_pressed()
{
  ui.ArmGuradGetPutBtn->setIcon(QIcon(":/image/4dai/pausearmgreen.png"));
  ui.ArmGuradGetPutBtn->setIconSize(QSize(161,51));
}

void MainWindow::on_ArmGuradGetPutBtn_released()
{
  ui.ArmGuradGetPutBtn->setIcon(QIcon(":/image/4dai/pausearmred.png"));
  ui.ArmGuradGetPutBtn->setIconSize(QSize(161,51));

  QDateTime time1 = QDateTime::currentDateTime();   //获取当前时间
  int timeT = time1.toTime_t();   //将当前时间转为时间戳

//  qnode.arm_cmd_send_.cmd_id = timeT;
//  qnode.arm_cmd_send_.cmd = 100;
//  qnode.armcmdSendPublish(qnode.arm_cmd_send_);

    qnode.qt_up_down_send_.cmd_id = timeT;
    qnode.qt_up_down_send_.cmd = 9;
    qnode.qt_up_down_send_.mode = 1;
    qnode.qt_up_down_send_.param = 200;
    qnode.QtUpDownPublish(qnode.qt_up_down_send_);
}

void MainWindow::on_MotorParashow_Semi_clicked()
{
    ui.stackedWidget->setCurrentWidget(ui.page_13);

    ui.Mainwindowshow->setIcon(QIcon(":/image/main2.png"));
    ui.Alarm->setIcon(QIcon(":/image/alarm2"));
    ui.Parametershow->setIcon(QIcon(":/image/par2"));
    ui.System->setIcon(QIcon(":/image/sys2"));

    ui.CancelPosition->hide();
    ui.FixPosition->hide();
    ui.CancelTask->hide();
    ui.ManualBrake->hide();
    ui.ManualRecover->hide();
}

void MainWindow::on_MotorReturn_Semi_clicked()
{
  ui.stackedWidget->setCurrentWidget(ui.page);
}

void MainWindow::on_MotorParashow_2_Cotton_clicked()
{
    ui.stackedWidget->setCurrentWidget(ui.page_6);

    ui.Mainwindowshow->setIcon(QIcon(":/image/main2.png"));
    ui.Alarm->setIcon(QIcon(":/image/alarm2"));
    ui.Parametershow->setIcon(QIcon(":/image/par2"));
    ui.System->setIcon(QIcon(":/image/sys2"));

    ui.CancelPosition->hide();
    ui.FixPosition->hide();
    ui.CancelTask->hide();
    ui.ManualBrake->hide();
    ui.ManualRecover->hide();
}

void MainWindow::CarTypeModeParaChange()
{
  if(CarTypeMode == 1)
  {
    CarTypeStatus = 1;
    MOTOR_NUM_T = 5;
  }
  else if(CarTypeMode == 2)
  {
    CarTypeStatus = 1;
    MOTOR_NUM_T = 6;
  }
  else if(CarTypeMode == 3)
  {
    CarTypeStatus = 2;
    MOTOR_NUM_T = 4;
  }
  else if(CarTypeMode == 4)
  {
    CarTypeStatus = 5;
    MOTOR_NUM_T = 3;
  }
  else if(CarTypeMode == 5)
  {
    CarTypeStatus = 4;
    MOTOR_NUM_T = 3;
  }
  else if(CarTypeMode == 6)
  {
    CarTypeStatus = 3;
    MOTOR_NUM_T = 6;
  }
}


}  // namespace gui



void gui::MainWindow::on_pushButton_clicked()
{
    ui.stackedWidget->setCurrentWidget(ui.page_14);
}

void gui::MainWindow::on_FanControlOpen1_pressed()
{
  ui.FanControlOpen1->setIcon(QIcon(":/image/chache/OpenBlue.png"));
  ui.FanControlOpen1->setIconSize(QSize(161,51));
}

void gui::MainWindow::on_FanControlOpen1_released()
{
  ui.FanControlOpen1->setIcon(QIcon(":/image/chache/OpenGreen.png"));
  ui.FanControlOpen1->setIconSize(QSize(161,51));

  int fanmode = 0;

  usb_clean_data_mode_send_.motor[0] = 1;
  FanControl[0] = 1;

  if(FanControl[1] == 1)
  {
    usb_clean_data_mode_send_.motor[1] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[1] = 0;
  }

  if(FanControl[2] == 1)
  {
    usb_clean_data_mode_send_.motor[2] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[2] = 0;
  }

  if(FanControl[3] == 1)
  {
    usb_clean_data_mode_send_.motor[3] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[3] = 0;
  }

  usb_clean_data_mode_send_.mode = 103;

  qnode.clean_mode_send_.data.clear();

  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.mode);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[0]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[1]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[2]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[3]);

  qnode.cleanModeSendPublish(qnode.clean_mode_send_);
}

void gui::MainWindow::on_FanControlClose1_pressed()
{
  ui.FanControlClose1->setIcon(QIcon(":/image/chache/CloseRed.png"));
  ui.FanControlClose2->setIconSize(QSize(161,51));
}

void gui::MainWindow::on_FanControlClose1_released()
{
  ui.FanControlClose1->setIcon(QIcon(":/image/chache/CloseBlue.png"));
  ui.FanControlClose1->setIconSize(QSize(161,51));

  usb_clean_data_mode_send_.mode = 103;
  usb_clean_data_mode_send_.motor[0] = 0;
  FanControl[0] = 0;

  if(FanControl[1] == 1)
  {
    usb_clean_data_mode_send_.motor[1] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[1] = 0;
  }

  if(FanControl[2] == 1)
  {
    usb_clean_data_mode_send_.motor[2] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[2] = 0;
  }

  if(FanControl[3] == 1)
  {
    usb_clean_data_mode_send_.motor[3] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[3] = 0;
  }

  qnode.clean_mode_send_.data.clear();

  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.mode);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[0]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[1]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[2]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[3]);

  qnode.cleanModeSendPublish(qnode.clean_mode_send_);
}

void gui::MainWindow::on_FanControlOpen2_pressed()
{
  ui.FanControlOpen2->setIcon(QIcon(":/image/chache/OpenBlue.png"));
  ui.FanControlOpen2->setIconSize(QSize(161,51));
}

void gui::MainWindow::on_FanControlOpen2_released()
{
  ui.FanControlOpen2->setIcon(QIcon(":/image/chache/OpenGreen.png"));
  ui.FanControlOpen2->setIconSize(QSize(161,51));

  usb_clean_data_mode_send_.motor[1] = 1;
  FanControl[1] = 1;

  if(FanControl[0] == 1)
  {
    usb_clean_data_mode_send_.motor[0] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[0] = 0;
  }

  if(FanControl[2] == 1)
  {
    usb_clean_data_mode_send_.motor[2] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[2] = 0;
  }

  if(FanControl[3] == 1)
  {
    usb_clean_data_mode_send_.motor[3] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[3] = 0;
  }

  usb_clean_data_mode_send_.mode = 103;

  qnode.clean_mode_send_.data.clear();

  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.mode);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[0]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[1]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[2]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[3]);

  qnode.cleanModeSendPublish(qnode.clean_mode_send_);
}

void gui::MainWindow::on_FanControlClose2_pressed()
{
  ui.FanControlClose2->setIcon(QIcon(":/image/chache/CloseRed.png"));
  ui.FanControlClose2->setIconSize(QSize(161,51));
}

void gui::MainWindow::on_FanControlClose2_released()
{
  ui.FanControlClose2->setIcon(QIcon(":/image/chache/CloseBlue.png"));
  ui.FanControlClose2->setIconSize(QSize(161,51));


  usb_clean_data_mode_send_.motor[1] = 0;
  FanControl[1] = 0;

  if(FanControl[0] == 1)
  {
    usb_clean_data_mode_send_.motor[0] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[0] = 0;
  }

  if(FanControl[2] == 1)
  {
    usb_clean_data_mode_send_.motor[2] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[2] = 0;
  }

  if(FanControl[3] == 1)
  {
    usb_clean_data_mode_send_.motor[3] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[3] = 0;
  }
  usb_clean_data_mode_send_.mode = 103;

  qnode.clean_mode_send_.data.clear();

  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.mode);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[0]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[1]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[2]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[3]);

  qnode.cleanModeSendPublish(qnode.clean_mode_send_);
}

void gui::MainWindow::on_FanControlOpen3_pressed()
{
  ui.FanControlOpen3->setIcon(QIcon(":/image/chache/OpenBlue.png"));
  ui.FanControlOpen3->setIconSize(QSize(161,51));
}

void gui::MainWindow::on_FanControlOpen3_released()
{
  ui.FanControlOpen3->setIcon(QIcon(":/image/chache/OpenGreen.png"));
  ui.FanControlOpen3->setIconSize(QSize(161,51));

  usb_clean_data_mode_send_.mode = 103;

  usb_clean_data_mode_send_.motor[2] = 1;
  FanControl[2] = 1;

  if(FanControl[0] == 1)
  {
    usb_clean_data_mode_send_.motor[0] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[0] = 0;
  }

  if(FanControl[1] == 1)
  {
    usb_clean_data_mode_send_.motor[1] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[1] = 0;
  }

  if(FanControl[3] == 1)
  {
    usb_clean_data_mode_send_.motor[3] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[3] = 0;
  }


  qnode.clean_mode_send_.data.clear();

  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.mode);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[0]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[1]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[2]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[3]);

  qnode.cleanModeSendPublish(qnode.clean_mode_send_);
}

void gui::MainWindow::on_FanControlClose3_pressed()
{
  ui.FanControlClose3->setIcon(QIcon(":/image/chache/CloseRed.png"));
  ui.FanControlClose3->setIconSize(QSize(161,51));
}

void gui::MainWindow::on_FanControlClose3_released()
{
  ui.FanControlClose3->setIcon(QIcon(":/image/chache/CloseBlue.png"));
  ui.FanControlClose3->setIconSize(QSize(161,51));

  usb_clean_data_mode_send_.mode = 103;
  usb_clean_data_mode_send_.motor[2] = 0;
  FanControl[2] = 0;

  if(FanControl[0] == 1)
  {
    usb_clean_data_mode_send_.motor[0] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[0] = 0;
  }

  if(FanControl[1] == 1)
  {
    usb_clean_data_mode_send_.motor[1] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[1] = 0;
  }

  if(FanControl[3] == 1)
  {
    usb_clean_data_mode_send_.motor[3] = 1;
  }
  else
  {
    usb_clean_data_mode_send_.motor[3] = 0;
  }

  qnode.clean_mode_send_.data.clear();

  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.mode);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[0]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[1]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[2]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[3]);

  qnode.cleanModeSendPublish(qnode.clean_mode_send_);
}

void gui::MainWindow::on_FanControlOpenAll_pressed()
{
  ui.FanControlOpenAll->setIcon(QIcon(":/image/chache/OpenBlue.png"));
  ui.FanControlOpenAll->setIconSize(QSize(161,51));
}

void gui::MainWindow::on_FanControlOpenAll_released()
{
  ui.FanControlOpenAll->setIcon(QIcon(":/image/chache/OpenGreen.png"));
  ui.FanControlOpenAll->setIconSize(QSize(161,51));

  usb_clean_data_mode_send_.mode = 103;

  usb_clean_data_mode_send_.motor[0] = 1;
  usb_clean_data_mode_send_.motor[1] = 1;
  usb_clean_data_mode_send_.motor[2] = 1;
  usb_clean_data_mode_send_.motor[3] = 0;
  FanControl[0] = 1;
  FanControl[1] = 1;
  FanControl[2] = 1;
  FanControl[3] = 0;

  qnode.clean_mode_send_.data.clear();

  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.mode);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[0]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[1]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[2]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[3]);

  qnode.cleanModeSendPublish(qnode.clean_mode_send_);
}

void gui::MainWindow::on_FanControlCloseAll_pressed()
{
  ui.FanControlCloseAll->setIcon(QIcon(":/image/chache/CloseRed.png"));
  ui.FanControlCloseAll->setIconSize(QSize(161,51));
}

void gui::MainWindow::on_FanControlCloseAll_released()
{
  ui.FanControlCloseAll->setIcon(QIcon(":/image/chache/CloseBlue.png"));
  ui.FanControlCloseAll->setIconSize(QSize(161,51));

  usb_clean_data_mode_send_.mode = 103;

  usb_clean_data_mode_send_.motor[0] = 0;
  usb_clean_data_mode_send_.motor[1] = 0;
  usb_clean_data_mode_send_.motor[2] = 0;
  usb_clean_data_mode_send_.motor[3] = 0;
  FanControl[0] = 0;
  FanControl[1] = 0;
  FanControl[2] = 0;
  FanControl[3] = 0;

  qnode.clean_mode_send_.data.clear();

  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.mode);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[0]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[1]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[2]);
  qnode.clean_mode_send_.data.push_back(usb_clean_data_mode_send_.motor[3]);

  qnode.cleanModeSendPublish(qnode.clean_mode_send_);
}
